Make base classes in two classes abstract?

Posts   
 
    
benjam47
User
Posts: 13
Joined: 09-Apr-2008
# Posted on: 06-Jun-2008 21:26:02   

I want to prevent my developers from accidentally creating a base entity class and bypass the custom validation and saving logic we will be adding to our entities. Is there a way to make the base classes in a two class scenario abstract?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Jun-2008 22:15:46   

Hi benjam, I can see two options here:

A. If you have some Business Classes, you could enforce the use of subclasses by demanding them from methods:

public void DoSometihng(MyCustomerEntity customerToUse)

B. Use the "General preset" (not "Two Classes"). This way you could write your business logic at partial classes and the programmers have only one class to instantiate.

Why did you choose "two classes" scenario over "one class"?

David Elizondo | LLBLGen Support Team