My-Entity

Posts   
 
    
mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 16-Feb-2009 10:10:09   

Greetings,

Any one help me about My-Entity !! when generate Classes from designer it generate also entities with prefix My what is this ?? and also LinqMetaData Used it ?? confused

I used LLBL version 2.6 Build FEB Template Binding to use Shard Template.Net 2.0 Adapter mode.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 16-Feb-2009 10:31:38   

You must be using the TwoClasses Scenario. To check this out , please go to the final tab in the Generate window. "Task Queue to Execute", and check which Preset is selected in the DropDownList.

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 16-Feb-2009 10:34:27   

Really.. I use TwoClasses Scenario

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 16-Feb-2009 10:39:12   

This generated 2 classes for each entity, a superClass and a subClass, with the Sub class prefixed with "My".

mohamed avatar
mohamed
User
Posts: 136
Joined: 10-Mar-2008
# Posted on: 16-Feb-2009 15:16:15   

Ok..Walaa

Let's clear it for me Why and when I need superClass and a subClass Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Feb-2009 04:13:21   

Hi Mohamed,

I don't think you need to use 2-class scenario. People usually use this when they need to code a lot of busniess logic code at entity-side.

I use Adapter Scenario almost all the time and personally I only use 2-class scenario when I need to extend a lot my entities, and in my case that is very infrequent. Most of the time people have their business project and they just need to add few things to their entities (via partial class or CODE_REGIONS), for example: custom properties, calculated fields, etc.

Another examples is when someone wants to extend a lot the entities (a lot of custom properties, a lot of methods, override this and that, etc), but they want to keep a flat-version of that entities (for serialization, for example). In that case 2-classes may suit appropriately.

For the rest, I think the General preset should be ok wink

David Elizondo | LLBLGen Support Team
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 17-Feb-2009 08:43:04   

So if we are to stick to having our business logic in the BL, we should avoid the "two class" since using them is so reminiscent to Self-Service as it allows for having the business logic and whatever in the actual entity (extended) class

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 17-Feb-2009 09:52:01   

So if we are to stick to having our business logic in the BL, we should avoid the "two class"

Yes.