DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

3
kicks
submitted by Lyhr 1 year, 1 month ago

morten.lyhr.dk — Basically multiplicity is not a concern of the client, so applying SOC we should remove the multiplicity from the client. How is that possible? Composite design pattern to the rescue.

Add a comment 3 comments | category: | Views: 2 | Get KickIt image code
tags: | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
Impressive. If only I knew what the hell he was talking about. This is one of those instances where a "foo" example isn't appropriate and should be replaced with one based on real life.
posted by yesthatmcgurk yesthatmcgurk 1 year, 1 month ago
I only disagree that collections are code smell. Generics are simplifying signature of collection but not Composite Pattern. Composite Design Pattern helps to build tree structure collection. For example whenever you need to manipulate with nested objects such as Family Tree, XmlNodes, WebControls, etc Composite Design Pattern is the best approach for it.

“The Rule of Thumb:
Usage of composite pattern is usually appropriate whenever there are hierarchical tree structures where all the tree nods are of the same type. “
Design patterns in real world use case scenarios, posted by Nikola Malovic - http://blog.vuscode.com/malovicn/archive/2007/08/16/design-patterns-in-real-world-use-case-scenarios-composite-part-2.aspx

Message for yesthatmcgurk, try to look at the Nikola Malovic blog post I mentioned above. Composite pattern is very simple, useful and unique.
posted by armencz armencz 1 year, 1 month ago
Point taken with the FooBar, next time there will be no FooBar ;-)

---

Why should the Composite pattern only deal with Tree structures? (The Composite Design pattern allows a client object to treat both single components and collections of components identically)

And anyways the composite class could easyly be rewirtten, to accept 2 instances of IFooBar. Then we could greate a tree structure by creating multiple coposites.
But whats the point? the list composite solved the problem?
posted by Lyhr 1 year, 1 month ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge