Help; New to LLBLGen

Posts   
 
    
Qeefahs
User
Posts: 5
Joined: 14-Feb-2009
# Posted on: 14-Feb-2009 14:37:15   

Dear all, I am evaluating LLBLGen and have read about the great features and tried it in some tests but would like to know from others who have used it of how to properly use it in a real project, I am interested in Web Applications.

I would like assistance with the following: 1. Are there any open source projects using LLBLGen where I could learn more of how LLBLGen is being utilized?

  1. I am thinking of using the adapter templates and would like to centralize all the DataAcessAdapter calls into a centralized location, including all calls to fetch and save entities and entities collections. Any Idea of whats the best ideas for doing such thing?

Many thanks simple_smile

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Feb-2009 20:17:24   

Qeefahs wrote:

  1. Are there any open source projects using LLBLGen where I could learn more of how LLBLGen is being utilized?

The best that comes to mi mind is this forum: http://www.llblgen.com/HnD/simple_smile

Qeefahs wrote:

  1. I am thinking of using the adapter templates and would like to centralize all the DataAcessAdapter calls into a centralized location, including all calls to fetch and save entities and entities collections. Any Idea of whats the best ideas for doing such thing?

Could you elaborate more, please?

David Elizondo | LLBLGen Support Team
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 16-Feb-2009 05:54:03   

Qeefahs wrote:

I am thinking of using the adapter templates and would like to centralize all the DataAcessAdapter calls into a centralized location, including all calls to fetch and save entities and entities collections. Any Idea of whats the best ideas for doing such thing?

Not 100% sure I understand your question, but . . .

When I start a project using LLBLGen Pro, I generally create a static utility class for entity fetches, entity collection fetches, and saves (one class each). Basically each is a wrapper for specific DataAccessAdapter functions, and I only expose the functionality I need--as I need more functions of the DataAccessAdapter (or overloads of a function), I add them to my class.

Posting complete classes from my current project might be confusing, as some of the methods are domain-sepcific. But one common example from my fetch utility, which allows fetching entities with single-field primary keys:

        internal static IEntity2 FetchEntityByType(object primaryKey, EntityType type)
        {
            return FetchEntityByType(primaryKey, null, type);
        }

        internal static IEntity2 FetchEntityByType(object primaryKey, IPrefetchPath2 prePath, EntityType type)
        {
            IEntity2 entity = (IEntity2)GeneralEntityFactory.Create(type);
            using (FetchAdapter adapter = new FetchAdapter())
            {
                ((IEntityField2)(entity.Fields.PrimaryKeyFields[0])).CurrentValue = primaryKey;
                adapter.FetchEntity(entity, prePath);
                if (entity.Fields.State != EntityState.Fetched)
                {
                    throw new EntityNotFoundException("Entity with ID: " + primaryKey.ToString() + " not found.");
                }
                return entity;
            }
        }

"FetchAdapter" is my derived version of the DataAccessAdapter, if that wasn't clear.

HTH,

Phil

Qeefahs
User
Posts: 5
Joined: 14-Feb-2009
# Posted on: 16-Feb-2009 13:55:54   

Thank you for the info posted,

regarding my second question, to further explain it lets assume that i have an entity called "News":

Lets assume that i will deal with "News" entities in different ways including: 1. fetch news by id 2. fetch collection of news where PostDate > "1st Feb 2009". 3. fetch last 5 news entities ordered by postdate. 4. save news entity/news collection.

I want to achieve the following:

  1. I would like the norm to be that at the GUI layer the DataAccessAdapter should not be called directly.

  2. The control of the fetches is done on a single/centralized location so when a change is needed -lets say on the sort condition of a returned result - the change is to be done at a specific location and all related GUI forms/pages will be affected.

  3. To make it easier at the GUI level, the calls to retrive the require entities should be simple and there is no need to pass the type of the entity retrieved.

The idea posted by "psandler" is similar to what i have in mind, what I am thinking of doing is to have a have a class with static methods such as GetNews(), GetLatestNews(),SaveNews(NewsEntity),SaveNews(NewsEntityCollection).. also i will add additional methods to the class as needed based on the scenarios I face.

I hope this make it clear.

Please let me know of what you think..

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 16-Feb-2009 14:01:29   

That's a typical 3-tier architecture where you need to have a Business Logic tier/layer. Like a dll which contains these methods for you, and you get to call it from the GUI.

Qeefahs
User
Posts: 5
Joined: 14-Feb-2009
# Posted on: 16-Feb-2009 14:15:29   

Walaa wrote:

That's a typical 3-tier architecture where you need to have a Business Logic tier/layer. Like a dll which contains these methods for you, and you get to call it from the GUI.

Dear Walaa, I understand your point and wanted to know if the community have could refine my idea of how to properly use the LLBLGen within the business layer.

Thanks again.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 16-Feb-2009 14:24:07   

Please search the forum for, "manager classes", or "manager templates". (without the quotes)

Qeefahs
User
Posts: 5
Joined: 14-Feb-2009
# Posted on: 16-Feb-2009 16:28:00   

Thanks; i have searched through the forums but unfortunately I haven't found a way to download the manager templates, i even tried to download them using TortoiseSVN and tried to use the repository browser but got a problems when tried to browse "svn://www.sd.nl/LLBLGenPro/" or "svn://www.sd.nl/LLBLGenPro/Templates/ManagersTemplates2.0/Trunk"

The error I am getting is: "cant connect to host www.sdl.nl: A connection attempt failed because the connected party did not properly respond after a period of time"...

Appreciate the assistance.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 16-Feb-2009 17:30:57   

Our subversion repository is offline indeed, as we merged servers a couple of weeks ago and haven't put up the subversion repository again yet.

I'll attach them to this post, just a moment. See attached file

(edit) btw: http://www.llblgen.com/tinyforum/GotoMessage.aspx?MessageID=84776&ThreadID=14296

Attachments
Filename File size Added on Approval
ManagerTemplates_2.6.zip 19,969 16-Feb-2009 17:38.36 Approved
Frans Bouma | Lead developer LLBLGen Pro
Qeefahs
User
Posts: 5
Joined: 14-Feb-2009
# Posted on: 16-Feb-2009 21:44:55   

Thank you all for the prompt responses and for your kind assistance.. ill check the templates later and will let you know and will update you if there is anything else.

  • Edit - How do I install the templates and configure LLBLGen to use the templates? I was able to install and use the templates flushed