Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Aspect questions? Date: Tue, 28 Feb 2012 00:04:24 -0800 Organization: albasani.net Lines: 80 Message-ID: References: <4f4a6b1d$0$290$14726298@news.sunsite.dk> <4f4ac151$0$291$14726298@news.sunsite.dk> <4f4ad9ff$0$292$14726298@news.sunsite.dk> <4f4c3df1$0$281$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net hsm86X6VqdLi1/jNh53lePf2SP+0nvNhSj6CbcjzLKUT5THkNsCJQX+EC1jlBL6GjiPY9PxhSs2pzVqx6VavtkBwghpTXU9rWRAeXRGUrJvKasS2c3vI/zVi/O/Ebdz0 NNTP-Posting-Date: Tue, 28 Feb 2012 08:04:20 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="8i5NpJJFcqLxpK6fzv5DGDuTNAslUljpbxu4iBHU+p2Z4UMYotAGc1+bzBX4VpjGYC8MdydFjDwVc0Doiy4ahGitOJADHsXcEprFZvkWWRno0YmUd7jqcZZYbL4Wn5f/"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f4c3df1$0$281$14726298@news.sunsite.dk> Cancel-Lock: sha1:stsrmncJyxefxlNbOCmrxs6Hr8E= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12480 Arne Vajhøj wrote: > Hmmm. > > I can not disagree that logical grouping is a driver for package > structure. > > But I don't believe that there is a single possible logical > grouping. I agree with you on this point. > Let us compare: > > 1) > > com.foobar > > 2) > > com.foobar.a > com.foobar.b > > 3) > > com.foobar.a.x > com.foobar.a.y > com.foobar.b.z > com.foobar.b.w > > 4) > > com.foobar.a.x.bla > com.foobar.a.x.blabla > com.foobar.a.y.zzz > com.foobar.a.y.zzzzz > com.foobar.b.z.one > com.foobar.b.z.two > com.foobar.b.w.lion > com.foobar.b.w.tiger > > In all of these 4 options the classes can be logical grouped. > > The question is at what granularity do you want to split. > > Everything in one package is not good. > > One package per class is not good. > > But somewhere in between one need to pick a level of > granularity. > > And packages was not invented for fun but to help the > developer. > > So one should pick the level of granularity that makes it > easiest to find things. > > According to this source: > > http://binstock.blogspot.com/2008/04/perfecting-oos-small-classes-and-short.html > then Thougthworks has recommended "no more than 10 classes per package". > > That seems a bit on the low side for me. > > YMMV You illustrate one way in which programming is a matter of art. Ultimately you do what makes the most sense to you at the time. This is where Patricia's advice to refactor willingly (but not willy-nilly, of course) takes the heat off having to have one right answer right away. “A good plan violently executed now is better than a perfect plan next week.” — General George S. Patton, Jr., U.S. Army (Gods! I hear this in George C. Scott's voice. I can't help it.) -- Lew No battle plan survives contact with the enemy.