Naming of subclasses

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 01-Sep-2006 01:37:03   

Is there any way to control the naming of subclasses? I'm using 2.0 and the adapter TwoClasses preset. It's kind of funny, because I can control the names of the files for each class, but not the class name itself. So it's easy to put my derived Person class in "PersonWhatever.cs", but the class name remains "MyPersonEntity". Looking at derivedEntityAdapter.template, it seems to me this is hardcoded.

I want to change it for a couple of reasons. One is aesthetic, the "My" prefix just seems kind of VB-ish. Also, I have a bunch of code that I was previously putting into a template, and I would prefer to put that code in subclassed entities now, and converting all my existing code that uses those entities will be easier if the derived class is, for example, "PersonEntity" (in which case I'll need to make the base class something different, like "PersonEntityBase"). To me, this would make it more clear that "PersonEntityBase" is 100% generated code, and "PersonEntity" contains additional code and is the entity that should be used.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 01-Sep-2006 08:32:40   

Please follow the steps mentioned in the following thread to have your custom template set instead of modifying the original template set http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6880

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 01-Sep-2006 15:41:02   

Ah, thanks, I had missed that thread!

KPx
User
Posts: 4
Joined: 18-Sep-2007
# Posted on: 18-Sep-2007 21:59:30   

Hi JimFoye,

Were you successful in creating a custom template for the two classes approach? I have the same interest you mention in this thread, but I am having trouble modifying the templates to work correctly.

I'm trying to achieve the two class, .net 2.0 adapter template, where OrderEntityBase is the generated base class, and OrderEntity is the sub class that inherits from the base. It is the class where my custom code resides.

I'm in the same situation where I've already coded an application, and want to move my custom code to a separate class for clarity, and I don't want to refactor the application to rename all the entities to MyOrderEntity, etc.

It would be great if you could share the template files if you were able to figure it out, or even a sample/instructions to help a fellow LLBLGen user! simple_smile

Thanks,

KP

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 19-Sep-2007 14:09:18   

Which version of LLBLGen Pro are you using?

KPx
User
Posts: 4
Joined: 18-Sep-2007
# Posted on: 20-Sep-2007 03:37:43   

Walaa wrote:

Which version of LLBLGen Pro are you using?

Hi Walaa, I'm using v2.0 of LLBLGen Pro.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 21-Sep-2007 20:11:39   

Have you tried the steps in the following thread? http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6880