views:

66

answers:

2

I am still learning MVP. I have a IView and a presenter. I have a custom List control that I have written for this application. I'd like to add some items to it, one at a time. Should I expose IView.AddItem(Item) or should I expose a IView.MyCustomList property?

Is this a matter of style, or is there a correct answer to this one?

A: 

Yea it is totally a matter of style and whatever one you feel more confortable with.

Burt
A: 

By not exposing your CustomList, you keep more control of HOW an item should be added to your CustomList. Exposing the AddItem method will protect your list more against possible abuse.

You can choose, it depends on how much control you want to keep over the list.

KoMet