|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
some design adviceA. what is the preferred way to load an object, say a Customer (from a db) 1. an instance member on the customer object customer.Load(id) 2. a static member on the customer class? Customer.Load(id) 3. an instance member on another class? customerManager.Load(id) 4. a static member on another class? CustomerManager.Load(id) B. What is a good way to load a subset of customers? CustomerList classFromAbove.GetCustomers(somefilter) want to be able to specify a filter (with ANDs, ORs, etc) on zero or more properties of a customer provide a sort order list provide a "page" size and "page" number and get a total recordcount back for items matching the filter without using sql in the filter, or sort order list :) Thanks! Neil Hello neilmcgui***@gmail.com,
First case: 1) Create CustomersManagement.Entity namespace that will contain Customer class 2) Create CustomersManagement.Data namespace with CustomerData class creating instances of Customer and returing ArrayList of them Second case: use O/R mapping and such tools as NHibernate Show quote > hi all Michael Nemtsev :: blog: http://spaces.msn.com/laflour> A. what is the preferred way to load an object, say a Customer (from a > db) > > 1. an instance member on the customer object > > customer.Load(id) > > 2. a static member on the customer class? > > Customer.Load(id) > > 3. an instance member on another class? > > customerManager.Load(id) > > 4. a static member on another class? > > CustomerManager.Load(id) > > B. What is a good way to load a subset of customers? > > CustomerList classFromAbove.GetCustomers(somefilter) > > want to be able to specify a filter (with ANDs, ORs, etc) on zero or > more properties of a customer > > provide a sort order list > > provide a "page" size and "page" number > > and get a total recordcount back for items matching the filter > > without using sql in the filter, or sort order list :) > > Thanks! > > Neil > --- WBR, "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche |
|||||||||||||||||||||||