• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

best way to map a design to a package structure

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen approach (b) for complex real life applications and approach (a) for simpler tutorial kind of applications.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic