Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Novice Newsgroups: comp.lang.java.programmer Subject: Re: Aspect questions? Date: Wed, 29 Feb 2012 15:11:30 +0000 (UTC) Organization: Your Company Lines: 58 Message-ID: References: <4f4a6b1d$0$290$14726298@news.sunsite.dk> <4f4c3a5a$0$292$14726298@news.sunsite.dk> NNTP-Posting-Host: Dmxgbnvd+eoRDUV2lwYf7Q.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: Xnews/5.04.25 X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: avast! (VPS 120229-0, 2012-02-29), Outbound message Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12530 Arne Vajhøj wrote in news:4f4c3a5a$0$292$14726298@news.sunsite.dk: > On 2/27/2012 9:04 PM, Novice wrote: >> Martin Gregorie wrote in >> news:jih660$s5$1@localhost.localdomain: >>> On Mon, 27 Feb 2012 05:20:48 +0000, Novice wrote: >>>> I've really struggled with this. I have things set up a certain way >>>> now but I'm constantly second-guessing myself and wondering if its >>>> the best way to do things. >>>> >>> In that case, leave the package structure as it is unless you find >>> problems with it. In fact I'd go so far as to say don't subdivide it >>> into separate packages unless there's a really good reason for doing >>> so. Once you've written a few programs, particularly if most of the >>> classes in them require access to at least one of your common >>> classes it becomes a real pain to repartition them between packages >>> because doing so will cost significant effort to go through all your >>> application classes and adjusting their 'import' statements. >>> >>> Most common classes tend to be quite small and you probably won't >>> have all that many of them: my collection has evolved over the last >>> 10 years and stand at 21 classes which contain 5800 lines of source >>> including the Javadocs documentation comments, so the collection >>> would have to grow by at least 50% before I'd consider splitting up >>> that package. >>> >> I'm surprised that your common class is so small in terms of number >> of classes, especially after 10 years! I would have thought you'd >> have written many more by now.... >> >> I've got 40 classes in mine already and those are just the ones I >> consider more-or-less finished. I've got many more in my >> CommonCandidates project where I store the ones that are still just >> half-baked (or less!).I'm regularly thinking of new ones to add.... > > You will know that you need to split when you start > spending time looking after the right class scrolling up > and down, because the list is long. > > I think I would have split before 40. > I'm torn on that. I could certainly resplit them but I really don't see much relationship between most of them. I do have a small handful that are really just String manipulation that could go together. But most of the rest are standalone. I also have a few classes that are basically used to create panels in GUIs. For instance, I have several class that will create a small panel containing a single field (text field, text area, spinner, checkbox or whatnot) with an optional label, but they're all independent of one another. It's entirely possible just to use one on a given GUI without ever having one of the others. Those don't feel related to me beyond the fact that they are JPanels so I'm not inclined to lump them together. -- Novice