While I have done little concrete plumbing of LINQ to my own DAL/BLL I would hesitate to base my own classes off of the classes generated by LINQ. My perspective is that the LINQ generated code often too closely models the underlying data architecture so some level of abstraction is desirable to decouple a BLL class from the DAL, be it your own or purely the LINQ to SQL data context.
I've been thinking about this issue myself lately and will very soon be diving into some new application work using LINQ. At this point I'm favoring the idea of maintaining my own business object library and handling the plumbing between the data store (SQL) and my object library. I realize this is extra work but until the entity framework is fully operational I'm still not entirely comfortable coupling business logic directly to generated types. For me this breaks the intention of the layer barrier.
Quote:
quote:
The idea of a BLL filled with static methods and having no object is too ugly by far.
|
I would hesitate to call this "too ugly". I have used what I call the "dumb object" architecture for a while. The business objects are essentially nothing more than data structures and there are business layer classes that do the work on those classes. Often the business objects are in separate assemblies which keeps them very portable. This is desirable where you might need to use those objects external to business logic processes such as in a distributed application where you connect to an application tier via remoting but want to keep the client app lightweight by not having libraries full of application logic that isn't used.
Another reason I often avoid the coupling of business logic to data - such as in a single business data/logic class, or "smart object" - is that of volume (for lack of a better term). Often the business layer works with collections of classes. Having a business logic class that contains logic as well as instance data feels clumsy to me when you start to work with multiple instances of the data. I find it much clearer to have a business logic class that can work with one or more instances of a class without each class having its own set of logic hanging off of it.
I'm not sure if that really answers your question, but hopefully it will provide some insight.
-Peter
compiledthoughts.com