Re: Re: suggestions for newbee

David Bernard <[email protected]> Wed, 06 Jul 2005 21:30:49 +0200
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
Artem Gr wrote:

>
>> I forgot some note about 'class addon'. If I want/need to add some 
>> method to Worker in another project/lib, then in the second project I 
>> create a file Worker.addon.nice in the same directory hierarchy 
>> (package) as the orginal Worker.nice. Like this it's easier tho know 
>> where is an implementation if you know the target class.
>>
>> Avantage : no inside AND ouside method definition
>
>
> This will lead to confusion when fields can be declared and when not. 
> We can add methods to existing class, but not fields. Therefore it is 
> sound to have a single class definition. Anyway, methods definition 
> outside class is cleaner: it separates instance fields definitions 
> from methods definitions, and having instance fields definitions 
> separated is very pleasant.

First thanks for response.

In Worker.addon.nice only methods and "abstracts interfaces" could be 
define it's an addon. see the following example :

// package are define by directory filename instead of directory 
hierarchy, it's because its more easier to see package with a 
filemanager (less click), it's a view ala Eclipse.

prj1/
    src/nice/
       pkg1.pkg11.pk111/
          MyClassA.nice
          MyClassB.nice

prj2/
    lib/
       prj1.jar
    src/nice/
       int.addon.nice //addon to int
       pkg2.pkg22/
          MyClassA.nice // an other class than pkg1.pkg11.pkg111.MyClassA
          MyClassC.nice
       pkg1.pkg11.pkg111
          MyClassA.addon.nice // definition of addons (methods, abstract 
interface) to the MyClassA define in prj1
          MyClassB.nice // => Conflict multiple definition

Now for other developper (than the original), it's easiest to know where 
is the definition of method in the prj2 and where to put extension. Like 
this in one view I could see which class are extended with addon in the 
Project prj2.

When You have project with lot of classes, navigate quickly in the 
source (without scrolling in big file or use IDE search features 
(fulltext, reference or definition)) is very productive.

>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Nice-info mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nice-info



-- 
--------------------------------------------------------------
David "Dwayne" Bernard             Freelance Developer (Java)
                                   mailto:[email protected]
      \|/                          http://dwayne.java-fan.com
--o0O @.@ O0o-------------------------------------------------



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click