architecture question

Posts   
 
    
erichar11
User
Posts: 268
Joined: 08-Dec-2003
# Posted on: 05-Feb-2004 11:56:12   

Hi Frans,

This is somewhat long winded, so please bare with me. I'm attempting to think through some architecture issues re: llblgen.

I was reading through the adapter docs and had some questions regarding the multi class/single table functionality in relation to what was discussed above: Self referencing entities. I like your idea of creating a supertype and subtypes.

So here is my thinking and wanted get your take on it. I have an organizatinal hierarchy I want to display via a tree control (Infragistics). Something like the following:

Company -- Business Unit 1 ------ Product A ------ Product B -- Business Unit 2 ------ Product C ------ Product D ------ Product E

So when a user clicks on Product A, the appropriate modules are displayed for that pagetype (ie. product pagetype). The pagetype(Product) consists of the following modules: Scope, milestones, deliverables, issues, etc.

A similar example is if a user clicks on "Business Unit 1". The pagetype(Business Unit) will again display the appropriate modules for the pagetype which will most likely be different from the pagetype(Product). The follwing modules will be displayed: Scope, Product Scorecard, deliverables, etc.

I'm trying to understand how to best accomplish this with llblgen.

  1. Now with the multi class/single table I could grad the table info as a collection and display it in a tree control I think. See any problem with this?

  2. When a user select a link in the organizational hierarchy, I create a new instance of the pagetype (probably via a factory Method) and grab the module info for the factory created from the db. Any thoughts on this.

  3. Lastly, we had talked before re: reporting. I need the capability to, for example, given a page type, show me a given module for all corresponding pagetypes. An example based on the hierarchy above, since Product A,B,C,D,E all contain a scope module and are of the same pagetype(Product), generate a report dynamically that shows scope for A through E. What ya think.

Sorry for the long winded post, but couldn't figure out how to best state what I'm trying to accomplish.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39826
Joined: 17-Aug-2003
# Posted on: 06-Feb-2004 13:55:06   

erichar11 wrote:

... 1. Now with the multi class/single table I could grad the table info as a collection and display it in a tree control I think. See any problem with this?

First of all, I'd like to say that you should decouple gui logic and bl logic as you should decouple bl logic from db logic (as much as possible). This means that you shouldn't design your application in a certain way just because it is handy to render it in a given control; changing the layout of the gui then automatically makes the bl design worthless (in a lot of occasions).

Then, the multi-class / single table idea is not something you really need. You can, if you want, create a new entity factory which creates, based on a type field, the right classes (product type classes for example). This then results in a collection with multiple instances of different class types. You can also avoid this and simply fetch the stuff in a collection and in the gui decide what to do, based on the extra field in the entity which contains the type of the entity (the field you also use to construct the different types in teh factory).

However, it's likely easier to use the different types approach, as you then can add per type different filters to retrieve related objects.

  1. When a user select a link in the organizational hierarchy, I create a new instance of the pagetype (probably via a factory Method) and grab the module info for the factory created from the db. Any thoughts on this.

I'd love to, but this would require some time to fully understand your architecture. simple_smile I can give you the advice to keep things as simple as possible (but not simpler wink ) and as I said above, decouple your logic: what a user does in a gui is only important to the gui. The gui then should simply react on what the user does, for example gathering information to display.

  1. Lastly, we had talked before re: reporting. I need the capability to, for example, given a page type, show me a given module for all corresponding pagetypes. An example based on the hierarchy above, since Product A,B,C,D,E all contain a scope module and are of the same pagetype(Product), generate a report dynamically that shows scope for A through E. What ya think.

I'd write some routines which construct predicates to filter on a given set of related objects based on an input entity, but as I said with 2), I'm not able to give a full answer because that will take a lot of time to see all pro/con conditions.

Sorry for the long winded post, but couldn't figure out how to best state what I'm trying to accomplish.

Don't be afraid to try! simple_smile Set up a small case, try some things out and compose pro/con lists of what is good/bad about the solution and what can be done about it. Don't be afraid to try things which you initially think will fail, they can become the best solution, just because you have overlooked something. Good luck simple_smile

Frans Bouma | Lead developer LLBLGen Pro