Help on choosing a valid pattern: composite or not?
- From: Carmine Moleti <carmineaskme@xxxxxxxxx>
- Date: Mon, 28 Nov 2005 13:37:18 +0100
Hi to everyone,
I'm just writing a toy application using C# to make some practice with Patterns and layers.
Now I'm faced with the "huge" dilemma of which pattern best suits the object oriented world I'm building.
I have one object which represents a net, whose node can either be: 1. A net 2. A proper node (of various kinds; Factories?!)
Both the "node" and the "net" have similarities in their interfaces.
For example: Net: - Add a node - Delete a node - Execute a node
Node: - Link to node (Could be translated as: Add a link to a node) - Unlink to node (Could be translated as: Delete a link to a node) - Execute
Node have some properties that Net doesn't have, and the clients are expected to deal with them.
If it's possible, I would like to implement clients so that they shouldn't have to care about the difference between "nodes" and "nets".
Without taking into account the "properties" aforementioned, from the GoF book I understand that the "Composite" pattern would be the
route to take.
The question is, is still "Composite" a good pattern to use if those "properties" are to be considered from a client stand point?
Thanks in advance for your help. Regards, Carmine .
- Follow-Ups:
- Re: Help on choosing a valid pattern: composite or not?
- From: CarmineM
- Re: Help on choosing a valid pattern: composite or not?
- From: H. S. Lahman
- Re: Help on choosing a valid pattern: composite or not?
- From: Mark Nicholls
- Re: Help on choosing a valid pattern: composite or not?
- From: mailtogops
- Re: Help on choosing a valid pattern: composite or not?
- Prev by Date: OOAD Study Guide
- Next by Date: Re: more dimensional method like a query...
- Previous by thread: OOAD Study Guide
- Next by thread: Re: Help on choosing a valid pattern: composite or not?
- Index(es):
Relevant Pages
|