Re: about implement "folder" with nanning-aop

Jon Tirsén <[email protected]> 22 Jun 2003 10:45:42 +0000
Newsgroups gmane.comp.java.nanning.devel
Message-ID <1056278742.6653.26.camel@localhost>
Excellent design I think. We have something very similar in our system.

A few points though:
 - You could split the NodeAspect in two (HasNameAspect and NodeAspect).
But you shouldn't necessarily do so if you feel that these two mixins
strongly belong to the same cross-cutting concern.
 - We don't use attributes the way you do. We feel that too much use of
attributes could violate the modularity of the aspect. So instead we
would specify in the NodeAspect what classes should be NodeItem and
NodeParent. This way you only have to change all things related to Nodes
in one place. We use attributes for "higher level"/declarative things
like "transaction", "cache" and so on. But it's a matter of philosophy
and taste, experience and time will tell what way is the best.

Otherwise, not much to say really. You're on the right track. When are
you going to start using this at your day-time job? :-)

On Fri, 2003-06-20 at 08:10, yiming wang wrote:
> hi all,
> 
> Recently, i am very interesting to convert some
> oo-design to aop-design with nanning. so , i try to 
> implement "folder" with nanning.
> 
> normally under oo design:
>  Folder -extends-> FolderItem
> 
> when i use aop to design this:
>   Folder -extends-> FolderItem
>     |                    |
>   FolderImpl -extends-> FolderItemImpl
> 
> FolderItem like a leaf, so i add class-level-tag
> "nodechild"
> Folder like a container, so i add class-level-tag
> "nodeparent", and more, Folder is a FolderItem, so
> Folder inherited attribute "nodechild" , cool!
> 
> also, i design the introductions "NodeChild" and 
> "NodeParent", i think they are very general for
> other object to use.
> 
> all source code and test case in the attached file 
> "folder.zip".
> 
> how do you think about my design? any comments?
> Thanks for your reply!
> 
> wang yiming
> 2003.6.20
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php