cybercrypt13

I found the following article on MSDN related to breaking my solution into logical layers. I understand the concept and very much want to give it a shot, however, I have over 300 database tables and counting and looking at what this guy is pushing for a single table is overwhelming and quite rediculous. Can anyone suggest an alternative or are you all really going to this much trouble to produce a single solution

http://msdn2.microsoft.com/en-us/library/aa581779.aspx

Thanks,

glenn




Re: Visual C# General Business Logic Layer Question

AndyJump

When working on medium to large projects people generally use some sort of ORM (Object-Relational Mapping http://en.wikipedia.org/wiki/Object-relational_mapping) to handle turning the tables into objects either dynamically or via code generation.

This can cut out months of work when there are lots and lots of tables, but it can still take quite a while to get everything setup and ready.

LINQ, which is included in .Net 3.5, is targetted at this problem and might well be worth looking at to see if its appropriate for your project. CLSA.Net (www.lhotka.net) is also supposed to be pretty good and a very complete solution.

You can always access the tables directly rather than providing objects to interact with them but this can lead to lots of problems, bugs and work. The OO route provides a single location for each table if something needs to change or a bug to be fixed. It also can be more flexable and can help facilitate caching, concurrency issues, remoting and other stuff I've no doubt forgotten about Smile





Re: Visual C# General Business Logic Layer Question

cybercrypt13

Thanks for the response, although it really has gotten me no closer to an answer. I can't believe that there isn't a simple way to just attach a delegate or something to a fields change event that we could call to do things. Having to write all this code just to provide a mechanism is crazy. Microsoft and everyone else pushes breaking things down into 3 layers but NO ONE provides a single workable example. If Microsoft if so dedicated to this stream of thinking why haven't they provided better tools

glenn