aspose file tools*
The moose likes Java in General and the fly likes Sub packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sub packages" Watch "Sub packages" New topic
Author

Sub packages

Charles Sexton
Ranch Hand

Joined: Sep 26, 2013
Posts: 192
While coding it is better to use sub packages for large appications? An example is that right now I am coding a client-server app and the gui has four dialogs and two abstract table models, that is six classes. Would it be good idea to add two sub packages one for dialogs and another for table models?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30546
    
150

Your example isn't a large application so either way is fine. For a larger application, you should absolutely split them up as you described. Or if you expect your application to grow. Or if you want to practice designing for larger applications.

In fact, you might even need more packages as the application grows. For example, suppose you had 100 table models. You might consider com.myapp.component.model at that point.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Charles Sexton
Ranch Hand

Joined: Sep 26, 2013
Posts: 192
Jeanne Boyarsky wrote:Your example isn't a large application so either way is fine. For a larger application, you should absolutely split them up as you described. Or if you expect your application to grow. Or if you want to practice designing for larger applications.

In fact, you might even need more packages as the application grows. For example, suppose you had 100 table models. You might consider com.myapp.component.model at that point.


Thank You, I will write code as if I was doing it for a large application and plus just like you said it allows for the application to grow in the future. I also think that it is much easier to navigate through classes as well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sub packages