One Large Assembly vs. Multiple Smaller Assemblies

Posts   
 
    
jader201
User
Posts: 33
Joined: 20-Mar-2007
# Posted on: 29-Jun-2007 17:27:20   

I'd like some feedback as to the various pros/cons to building one assembly per database, vs. splitting the database into multiple groupings.

For example, we have a database with close to 800 tables. It would seem obvious that these should be split into smaller LLBL projects. However, if we do this, we will undoubtedly break some relationships between entities shared across the projects.

Our situation is nowhere near this simplified, but just to demonstrate my point, let's say you have a database with orders and customers. Say that your tables that make up your order data would be under one project, and the tables that make up customer data would be under another.

Now say we populate an orders collection with all orders. In order to get to the customers on each order, you would have to explicitly create a separate customer entity and load it manually by the customer ID on each order.

Would we be better to go ahead and keep the entire database in one project, even if it is close to 800 tables? Or, should we live with the fact that we'll have to, in some cases, manually fetch data into entities that are shared across projects?

Thanks in advance for your feedback.

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 29-Jun-2007 17:50:10   

The basic rule of thumb is to keep everything in the same assembly unless you have a very good reason to split it out. There are a lot of reasons for this, but a few of them are:

  1. Compile times go up almost exponentially when you add assemblies
  2. You reduce admin overhead by eliminating/reducing cyclic dependencies
  3. Fewer moving parts to track, deploy, version, and maintain

There are more reasons, but if you find the need to segment, use namespaces as your first option. Besides that, I don't believe multiple projects are supported under LLBLGen for what it generates.

Jeff...

stefcl
User
Posts: 210
Joined: 23-Jun-2007
# Posted on: 29-Jun-2007 19:43:03   

Hello,

I would avoid splitting the database into multiple assemblies too.

Talking about that Customer/Orders relation in your example... If I had to deal with IDs and query logic in my code, I would feel like I am losing the benefits of object-oriented programming.

Splitting into two assemblies is nice but I'm not sure it makes sense if both are required in order to run the application.