Purpose of [X]Entity and My[X]Entity

Posts   
 
    
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 04-Nov-2006 22:01:51   

I am experimenting with the different templates for code generation.

I generated code using Adapter Two Class 2005. This generated [X]Entity and My[X]Entity. My[X]Entity is an extension of [X]Entity, but there does not appear to be any additional functionality.

What are the pros/cons of the _Two Class method _over the General method? What type of scenerio would benefit from the Two Class method?

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 04-Nov-2006 23:58:35   

jmeckley wrote:

What are the pros/cons of the _Two Class method _over the General method? What type of scenerio would benefit from the Two Class method?

It's really a matter of preference. Some people like to have the objects they use and modify be in their own file so that they aren't messing with the generated code. So the My[X]Entity classes are just empty class files that inherit from [X]Entity and are waiting for you to add additional functionality to them. You could instead add additional functionality to the [X]Entity classes inside of the user code regions specified in the class file.

In .NET 2.0 you can use partial classes instead of inheritance, so this offers yet another choice.