Team development

Posts   
 
    
Posts: 11
Joined: 09-May-2005
# Posted on: 11-Jun-2005 14:52:35   

How can I solve below problems:

3 developers develop a portal system: . developer Core builds core system like security, admin, login, navigation, ... . developer Ann builds announcements module . developer Polls builds polls module

From the beginning, developer Core generate DAL for core system, build BLL and all PL for the portal. core system's DAL namespace is MY.Portal.DAL, assembly is MY.Portal.DAL.Core.dll

After that, Ann builds announcements module, he wants add announcements table, generate DAL. Can Ann generate DAL for announcements table without have to re-genereate DAL of the core system? FYI: announcements table link to modules table (in core system) on ModuleID field. We have done this. generate DAL, I click at Generate, I choose "Create participating object subset", select Announcements table, at the same time, modules table is checked. I unchecked modules table so that LLBLGenPro generate only DAL for announcements table only. announcements' DAL namespace is MY.Portal.DAL, assembly is MY.Portal.Announcements.DAL.dll. Now, I try to compile announcements' DAL, I add reference to MY.Portal.DAL.Core.dll, then compile, I get this few errors:

C:\Temp\DAL Announcements\1758\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(49): The type or namespace name 'ModulesEntity' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\DAL Announcements\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(401): The best overloaded method match for 'MP.Portal.DAL.FactoryClasses.EntityFieldFactory.Create(MP.Portal.DAL.AnnouncementsFieldIndex)' has some invalid arguments
C:\Temp\DAL Announcements\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(401): Argument '1': cannot convert from 'MP.Portal.DAL.ModulesFieldIndex' to 'MP.Portal.DAL.AnnouncementsFieldIndex'

last 2 erros happen at this code

public virtual IRelationPredicateBucket GetRelationInfoModules()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(EntityFieldFactory.Create(ModulesFieldIndex.ModuleId), null, ComparisonOperator.Equal, this.ModuleId));
            
            return bucket;
        }

I look at EntityType, I see this

public enum EntityType:int
    {
        AnnouncementsEntity
    }

Same problem if developer Polls want to develop Polls modules.

I know that if we generate DAL for all tables in 1 project (1 DAL), and add to the system, it works exellent. But we have several developers work in different area of the project, and we don't want to re-build DAL, add to source safe, ask everyone to get latest version of DAL project and build. FYI: here is EntityType enum if we build all tables in one DAL

public enum EntityType:int
    {
        AnnouncementsEntity,
        ArticlecategoriesEntity,
        ArticlereviewsEntity,
        ArticlesEntity,
        ArticlesoncategoriesEntity,
        ArticlesonmodulesEntity,
        ArticlestatusEntity,
        ArticlestatuslogsEntity,
        BadwordsEntity,
        ContactsEntity,
        DiscussionEntity,
        DocumentsEntity,
        EventcarlendarEntity,
        EventsEntity,
        FaqEntity,
        FaqcategoryEntity,
        HtmltextEntity,
        LinksEntity,
        LogEntity,
        LoginhistoryEntity,
        ModuledefinitionsEntity,
        ModulesEntity,
        ModulesettingsEntity,
        PollanswerEntity,
        PollquestionEntity,
        PortalsEntity,
        RolesEntity,
        TabsEntity,
        ThemesEntity,
        UserrolesEntity,
        UsersEntity,
        WhoonlineEntity
    }

This basicly is to break one DAL from a large project into independant and smaller DAL for easy to develop. I hope that this make sense...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 12-Jun-2005 14:13:21   

smiledragon wrote:

How can I solve below problems:

3 developers develop a portal system: . developer Core builds core system like security, admin, login, navigation, ... . developer Ann builds announcements module . developer Polls builds polls module

From the beginning, developer Core generate DAL for core system, build BLL and all PL for the portal. core system's DAL namespace is MY.Portal.DAL, assembly is MY.Portal.DAL.Core.dll

After that, Ann builds announcements module, he wants add announcements table, generate DAL. Can Ann generate DAL for announcements table without have to re-genereate DAL of the core system? FYI: announcements table link to modules table (in core system) on ModuleID field. We have done this. generate DAL, I click at Generate, I choose "Create participating object subset", select Announcements table, at the same time, modules table is checked. I unchecked modules table so that LLBLGenPro generate only DAL for announcements table only. announcements' DAL namespace is MY.Portal.DAL, assembly is MY.Portal.Announcements.DAL.dll. Now, I try to compile announcements' DAL, I add reference to MY.Portal.DAL.Core.dll, then compile, I get this few errors:

C:\Temp\DAL Announcements\1758\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(49): The type or namespace name 'ModulesEntity' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\DAL Announcements\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(401): The best overloaded method match for 'MP.Portal.DAL.FactoryClasses.EntityFieldFactory.Create(MP.Portal.DAL.AnnouncementsFieldIndex)' has some invalid arguments
C:\Temp\DAL Announcements\DatabaseGeneric\EntityClasses\AnnouncementsEntity.cs(401): Argument '1': cannot convert from 'MP.Portal.DAL.ModulesFieldIndex' to 'MP.Portal.DAL.AnnouncementsFieldIndex'

last 2 erros happen at this code

public virtual IRelationPredicateBucket GetRelationInfoModules()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(EntityFieldFactory.Create(ModulesFieldIndex.ModuleId), null, ComparisonOperator.Equal, this.ModuleId));
            
            return bucket;
        }

I look at EntityType, I see this

public enum EntityType:int
    {
        AnnouncementsEntity
    }

Same problem if developer Polls want to develop Polls modules.

If you're using 1.0.2004.1, this is indeed a problem. In 1.0.2004.2, the code generate should compile for the objects you've selected, i.e.: it shouldn't generate references into the code for entities which aren't in your set.

I know that if we generate DAL for all tables in 1 project (1 DAL), and add to the system, it works exellent. But we have several developers work in different area of the project, and we don't want to re-build DAL, add to source safe, ask everyone to get latest version of DAL project and build. FYI: here is EntityType enum if we build all tables in one DAL

This basicly is to break one DAL from a large project into independant and smaller DAL for easy to develop. I hope that this make sense...

You can also do: create 3 llblgen pro projects: one for the Core, one for the Announcements and one for the Polls. All on the same database. They then can be used to generate code into separate namespaces etc. without a problem.

Though it should work if you use 1 complete project and select the participating objects for the different projects, save them as a group (1.0.2004.2 feature) selection, so you can re-select them later on easily.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 11
Joined: 09-May-2005
# Posted on: 12-Jun-2005 15:48:10   

I have upgraded to 1.0.2004.2. Then try to compile My.Portal.DAL.Core. I select few core tables which not include Announcements table, Polls table, and other modules, just select tables related to core system.

When compile, I get a lot of errors... here is few errors related to Announcements table & Polls table

C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(299): The type or namespace name 'AnnouncementsEntity' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(339): The type or namespace name 'PollquestionEntity' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(695): The type or namespace name 'AnnouncementsFieldIndex' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(835): The type or namespace name 'PollquestionFieldIndex' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(1492): The type or namespace name 'AnnouncementsEntityFactory' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(1494): 'MP.Portal.DAL.EntityType' does not contain a definition for 'AnnouncementsEntity'
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(1652): The type or namespace name 'PollquestionEntityFactory' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(1654): 'MP.Portal.DAL.EntityType' does not contain a definition for 'PollquestionEntity'
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(2176): No overload for method 'TypeContainedAttribute' takes '0' arguments
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(2176): The type or namespace name 'AnnouncementsEntity' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(2184): The type or namespace name 'AnnouncementsEntityFactory' could not be found (are you missing a using directive or an assembly reference?)
C:\Temp\MP.Portal.DAL.Core\DatabaseGeneric\EntityClasses\ModulesEntity.cs(2394): The type or namespace name 'PollquestionEntityFactory' could not be found (are you missing a using directive or an assembly reference?)

FYI: below are code of ModulesEntity.cs

public override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
        {
            switch(propertyName)
            {
                case "Moduledefinitions":
                    this.Moduledefinitions = (ModuledefinitionsEntity)entity;
                    break;
                case "Tabs":
                    this.Tabs = (TabsEntity)entity;
                    break;
                case "Announcements":
                    // add it to the collection as well. 
                    this.Announcements.Add((AnnouncementsEntity)entity);
                    break;
                case "Articlesonmodules":
                    // add it to the collection as well. 
                    this.Articlesonmodules.Add((ArticlesonmodulesEntity)entity);
                    break;
                case "Contacts":
                    // add it to the collection as well. 
                    this.Contacts.Add((ContactsEntity)entity);
                    break;
                case "Discussion":
                    // add it to the collection as well. 
                    this.Discussion.Add((DiscussionEntity)entity);
                    break;
                case "Documents":
                    // add it to the collection as well. 
                    this.Documents.Add((DocumentsEntity)entity);
                    break;
                case "Events":
                    // add it to the collection as well. 
                    this.Events.Add((EventsEntity)entity);
                    break;
                case "Faq":
                    // add it to the collection as well. 
                    this.Faq.Add((FaqEntity)entity);
                    break;
                case "Htmltext":
                    // add it to the collection as well. 
                    this.Htmltext.Add((HtmltextEntity)entity);
                    break;
                case "Links":
                    // add it to the collection as well. 
                    this.Links.Add((LinksEntity)entity);
                    break;
                case "Modulesettings":
                    // add it to the collection as well. 
                    this.Modulesettings.Add((ModulesettingsEntity)entity);
                    break;
                case "Pollquestion":
                    // add it to the collection as well. 
                    this.Pollquestion.Add((PollquestionEntity)entity);
                    break;
                case "Quizquestion":
                    // add it to the collection as well. 
                    this.Quizquestion.Add((QuizquestionEntity)entity);
                    break;
                case "Surveyquestion":
                    // add it to the collection as well. 
                    this.Surveyquestion.Add((SurveyquestionEntity)entity);
                    break;
                case "ArticlesCollectionViaArticlesonmodules":
                    // add it to the collection as well. 
                    this.ArticlesCollectionViaArticlesonmodules.IsReadOnly = false;
                    this.ArticlesCollectionViaArticlesonmodules.Add((ArticlesEntity)entity);
                    this.ArticlesCollectionViaArticlesonmodules.IsReadOnly = true;
                    break;
                case "FaqcategoryCollectionViaFaq":
                    // add it to the collection as well. 
                    this.FaqcategoryCollectionViaFaq.IsReadOnly = false;
                    this.FaqcategoryCollectionViaFaq.Add((FaqcategoryEntity)entity);
                    this.FaqcategoryCollectionViaFaq.IsReadOnly = true;
                    break;
                case "QuiztypeCollectionViaQuizquestion":
                    // add it to the collection as well. 
                    this.QuiztypeCollectionViaQuizquestion.IsReadOnly = false;
                    this.QuiztypeCollectionViaQuizquestion.Add((QuiztypeEntity)entity);
                    this.QuiztypeCollectionViaQuizquestion.IsReadOnly = true;
                    break;
                case "SurveytypeCollectionViaSurveyquestion":
                    // add it to the collection as well. 
                    this.SurveytypeCollectionViaSurveyquestion.IsReadOnly = false;
                    this.SurveytypeCollectionViaSurveyquestion.Add((SurveytypeEntity)entity);
                    this.SurveytypeCollectionViaSurveyquestion.IsReadOnly = true;
                    break;

                default:
                    // do nothing
                    break;
            }
        }

As my understand, This is because modules table has relationship with anouncements table and others, so it asks for announcements entity. So if I generate My.Portal.DAL.Announcements for announcements table, it will ask for modules entity which is in DAL.Core (which can't compile at the moment).

Could you please advise what I should do?

The grouping (after clicking Generate...) is very good because it remembers my table selections. I like it !!!

Back to my previous question, my purpose is to break our development for several developers. eg.

DAL.Core.dll saves DAL of table 1 (core) table 2 (core) table 3 (core)

DAL.Announcements (reference to DAL.Core.dll) saves DAL of announcements table

DAL.Polls (reference to DAL.Core.dll) saves DAL of polls table and (polls related tables)

It would be a big advantage for us if LLBLGen Pro could solve our problems?

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 12-Jun-2005 17:36:28   

Working on fix in TDL interpreter. There are some routines left which allow relations to be processed which point to entities which aren't selected. The groups selections normally should have the related entities also selected, as these are 1:1 or m:1 relations and will cause save problems during runtime.

For example, if you have just selected 'customer' and 'order' in Northwind, with the current code it won't compile, as shipper and employee aren't available and 'order' references them.

I've now a working TDL interpreter (I'll upload a fix shortly) which will produce proper code, though at runtime, I can't save an order, as the employee/shipper FK fields are not set and they're also not nullable. This is the reason why this issue wasn't fixed before in the current code.

It therefore is mandatory that the FK fields to non-included entities are nullable.

I'll post here when the updated interpreter is available. (as in: within 10, 20 minutes)

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 12-Jun-2005 17:53:48   

An updated task performers archive is now available which should give compilable code for you. Please read my note in my previous posting about saving entities and FK fields.

You can just download the task performers archive, from the Taskperformers section in the customer area, as your designer etc. is already up to date. Then, regenerate your code.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 11
Joined: 09-May-2005
# Posted on: 13-Jun-2005 08:26:42   

Thanks for your quick reply. I give it a try tomorrow and let you know later.