Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Aspect questions? Date: Sun, 26 Feb 2012 23:43:20 +0000 (UTC) Organization: UK Free Software Network Lines: 28 Message-ID: References: <4f4a6b1d$0$290$14726298@news.sunsite.dk> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1330299800 11736 84.45.235.129 (26 Feb 2012 23:43:20 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Sun, 26 Feb 2012 23:43:20 +0000 (UTC) User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12395 On Sun, 26 Feb 2012 21:08:49 +0000, Novice wrote: > So, with respect to my common classes, should they all be in one big > package, like com.novice.common? Or is it better to group them on some > basis so that different types of common modules are in their own > packages? If grouping them is a good idea, what's the best way to group > them? > I'd say generally yes, unless you see a definite reason to put another (set of) class(es) in a separate package. Example: My common set forms the org.gregorie.environ package because I regard these as setting an environment for the stuff I write. However, I also do a bit of image manipulation and found I was writing repetitive common code in this area, so that got refactored as classes in the org.gregorie.image package. And so forth.... Any time you find this approach puts a class where you don't expect to find it, consider changing your package structure. Its helpful if your 'common' package only contains classes that are likely to be useful for any program you write (e.g logging and command line parsing) and that your other packages contain classes that are often used together. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |