.netdomain-driven-design

Why wouldn't I want to use BindingList<T> in my domain model classes?


I am starting to code a fresh domain model. I plan to use NHibernate to persist my classes later on.

I am building an application that is mainly used for optimising transportation. My domain model has one important class in in that is called Model, which represents the current situation that I want to optimize. It is basically a container for other containers (Vehicles, Locations, Jobs and such). I am thinking that inheriting the containers from BindingList<T> would make my life easier when binding the object to grids and such later on.

Do you think it is a good idea or has my approach some obvious loop holes ?

EDIT: Ok. Binding list may be too tied to the presentation layer. I

Is using List<T> such a problem as well ?


Solution

  • You should create a presentation layer and if needed - use BindingList there.

    Domain model does not care about persistance or how you are going to show data.