1

I don't see the difference between both cases. It began when I wanted to have some special list (e.g. with some navigation or title on the top). But then I didn't know what to do, should I extend List and override some methods, or should I simply create a skin for the existing List component? thnx

ketan
  • 19,129
  • 42
  • 60
  • 98

1 Answers1

1

If you're just looking for visual modifications, you should most likely just skin the component.

Creating a custom component, that extends List, or using composition would suggest that you need some additional functionality that List itself do not provide to serve your purpose. If the case is the latter, then you should use inheritance or composition.

  • If I am going to add a component to another component (e.g. If I want to add my own button with some functionality at the top of a List), wouldn't this be a composite component? i.e. why not then creating a composite component by extending "List" class? – Teacher Box Feb 18 '12 at 19:02