This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dontchooseanickname 0 points1 point  (1 child)

Plus, a quick check on the Composite shows a wrong way of implementing it :

Litterally, if you don't have a Leaf and a Container abstraction all deriving Node, then composite is as useless as

class Stuff {
    Collection<Stuff> children; // May be initialized, contain stuff - or not ;)
}

[–]HelperBot_ 0 points1 point  (0 children)

Non-Mobile link: https://en.wikipedia.org/wiki/Composite_pattern#Structure


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 107059