jQuery in Action, 3rd edition
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Part II- package structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Part II- package structure" Watch "Part II- package structure" New topic

Part II- package structure

Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151

For packaging the classes, here are the two approches I am thinking.

1) grouping them by tiers.
Ex.. com.fbn.(presentation/business/integration/common).xxxxxx

and for JSPs, : web.fbn.jsp.xxxx

2) other approach is package by usecases. Classes related to usecase are kept under package like : com.fbn.login.api.*****

Can anyone suggest, which one is better? I am inclining more towards First approach.

Thank you,

[ February 14, 2005: Message edited by: Prasad Kuppa ]
subramanian radhakrishnan

Joined: Feb 18, 2005
Posts: 25
I am also having similar thoughts like u on the
first approach.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 446

I would suggest:

Divide the application into top level packages based on the functionality. Then divide each of the package into tier level packages.

There is a nice article out there at Sun's website about breaking down the application into packages.

You can also have top level breakup on the basis of tiers and then second level breakup on the basis of functional modules.

I do not think it is a good idea to map package structure to use case. It may result in mushroom growth of packages.

Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
I spent some time searching with Google...but could not find the article.

If anyone does know of any Sun article that explains best practices on J2EE java packaging (I mean com.companyname.xxx packaging and not WAR/JAR/EAR packaging)...do let me know !.. Thanks a lot.

Looks like there's still no confident/best practice answer in this thread...

I agree. Here's the link: http://aspose.com/file-tools
subject: Part II- package structure
It's not a secret anymore!