Help on choosing a valid pattern: composite or not?



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
.



Relevant Pages

  • Re: OT: Binary Search - Should They Know It?
    ... rather thanSOA based architecture may cause you big maintenance headaches. ... Your managers reaction to layers is the reacton of my previous boss, ... It is also a good reason to standardise what patterns you are using and try ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: dip Notions 2 Major Errors
    ... Well, the DIP motivates us to use Strategy, Bridge or similar patterns. ... > all MANDATE higher levels eve depending upon abstract interfaces to ... > layers DEPEND upon lower layers for services. ...
    (comp.object)
  • Re: Over the River Embroidery -- One Done!
    ... the instructions have you stitch through two layers so the thread ... together so the two fabrics do not bunch. ... Here is a page to the sites blog that shows these patterns done by ... If I do one panel in August and one in September, ...
    (rec.crafts.textiles.quilting)
  • Re: random or urandom???
    ... >> random values followed by followed by 27 layers of specific repeated ... >> patterns intended to comprehensively erase material based on both MFM ... A hammer is a lot cheaper. ... But this disk OTOH being treated this way ...
    (comp.os.linux.security)
  • Re: Calling all/any Majorette uniform makers!
    ... I was looking at the Specialty Sportswear patterns ... be cut drastically with a minor investment that I could pass along to ... FIT HORRIBLY!! ... She writes that her clients ...
    (alt.sewing)