• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing project folder structure  RSS feed

 
Oscar Gonzalez
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm mostly a web developer with struts and now I'm going to create a new stand alone program, but I don0t know how to handle the folder or directory structure, is there a standard way to name the directories?

In the web projects we usually separate the "back endo code" and the GUI in two different components, but I don't know how to do it while using swing.

For example where the GUI stuff and main will be?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually have a base app package

com.[domain].[appname]

Under which I will have my Main class that launches the app. No GUI code in there. More or less a main method and init stuff. Then I start my ui package

com.[domain].[appname].ui

under which I'll have my MainFrame class that subclasses JFrame and other JPanels and what not. Everything business related goes under whatever package structure you want and can be the same as your web package.

com.[domain].[appname].model - POJO's mainly
com.[domain].[appname].database - dao stuff
com.[domain].[appname].services - you get the idea

That is by no means the only way.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!