C
cmay
I am trying to build more applications using a more OO approach, with
more seperation of business and presentation logic.
One problem I am running into involves the design philosophy behind
using a rich domain.
Lets say that for a specific page you need to view all the line items
for a given order, and produce some aggregrate information about those
line items.
Now, the cheap and dirty method would be to just fetch a dataset, loop
through it to do any aggregrate calculations you need for the footer,
and then databind it to a datagrid.
If you were to do this same task w/ a rich domain model, you would
probably get an Order object that contained a collection of Line Items.
This means you would have to instantiate an object for every line item,
only to turn around and do nothing while those items (other than just
databinding the results to a datagrid).
So, am I designing this correct, or is there a better way to do this?
How do people who follow the rich domain model deal with issues like
this? In this example, there usually wouldn't be a ton of line items,
but in other applications you could have hundreds of items. I am
thinking the performance penality would be really large.
more seperation of business and presentation logic.
One problem I am running into involves the design philosophy behind
using a rich domain.
Lets say that for a specific page you need to view all the line items
for a given order, and produce some aggregrate information about those
line items.
Now, the cheap and dirty method would be to just fetch a dataset, loop
through it to do any aggregrate calculations you need for the footer,
and then databind it to a datagrid.
If you were to do this same task w/ a rich domain model, you would
probably get an Order object that contained a collection of Line Items.
This means you would have to instantiate an object for every line item,
only to turn around and do nothing while those items (other than just
databinding the results to a datagrid).
So, am I designing this correct, or is there a better way to do this?
How do people who follow the rich domain model deal with issues like
this? In this example, there usually wouldn't be a ton of line items,
but in other applications you could have hundreds of items. I am
thinking the performance penality would be really large.