• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to map a design to a package structure

 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, when designing app, we have horizontal layers (e.g. view, business, persistence) and vertical slices, which are more domain driven (e.g. customer, billing, common).

I can think of two ways to map this to a package structure:

(a) Taking the horizontal layer as parent, e.g.:
view.customer
persistence.customer
persistence.billing


(b) Taking the vertical slice as parent, e.g.:
customer.view
billing.persistence
common.view


I am noticing that well structured apps often go for the (b) approach and architects and teams see their technical projects more as modules and focus on domain-thinking. In the other case I have seen that the (a) approach often leads to package decay, because people tend to only see these three layers (view, business, persistence).

Of course you can both way structure an application well (it all depends on the team quality awareness). It is just a tendency I have noticed so far.

How about you? Maybe you go a complete different approach to map your design to package structure?

Thanks for your thoughts!
 
bryan nelson
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting question...even though the thread is a bit old.

Actually I've been doing some research into the best way to organize packages lately and have found this discussion on packaging to be extremely helpful; the other discusses packaging by feature vs layer. I think that on the surface packaging by layer (your horizontal slice above) looks more attractive...but it also takes less thought. However, packaging by feature (your vertical slice above) seems to have more expandability.

Does anyone else have anything to add to this discussion?
 
Victor Ramen
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen approach (b) for complex real life applications and approach (a) for simpler tutorial kind of applications.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic