Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> An implementation of LLBL that wraps the Entity classes rather than using inheritance
 

Pages: 1
Architecture
An implementation of LLBL that wraps the Entity classes rather than using inheritance
Page:1/1 

  Print all messages in this thread  
Poster Message
Mountain
User



Location:
Florida
Joined on:
01-Apr-2005 05:05:51
Posted:
21 posts
# Posted on: 06-Apr-2005 16:44:32.  
Has anyone succeeded (or tried and failed) in using a Wrapper design pattern to implement LLBL? In this approach, the proprietary business entities would wrap (contain) the LLBL entities rather than inherit from them.

Ideally, the proprietary business entities and the LLBL entities would reside in separate assemblies too.

It looks to me like this is not possible with the current architecture. For example, in SetRelatedEntityProperty, the generated code expects to be able to cast the IEntityCore entity to it's LLBL entity type. This is expected to be either the entity itself or a class derived from the entity. However, if it is a class containing the entity (wrapper), this cast fails.

Code:
        public override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
        {
            switch(propertyName)
            {

                case "Person":
                    this.Person = (PersonEntity)entity;
                    break;


One solution would be to use an explicit conversion operator in C#, but this doesn't seem possible if the 2 classes are in different assemblies with the LLBL assembly not knowing about the proprietary biz ent assembly (both referencing each other would create a circular ref).

Any comments or ideas are appreciated. Thanks!
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.