Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing generic delegate to business objects
Message
From
30/10/2008 16:26:04
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
30/10/2008 09:22:45
General information
Forum:
ASP.NET
Category:
Class design
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01357813
Message ID:
01358483
Views:
26
>Tim,
>
>>I am not sure I understand your idea so don't get offended if I get it wrong. It sounds like you are asking for the UI to know all about (have a reference to) the business tier AND the business tier to know about (have a reference to) the UI. It may be that you are having problems because you are attempting to create a circular reference by fooling it. Why is it you need business logic to create forms? Can you just raise an event in the business logic that allows the UI to create it's own form?
>
>Thank you.
>Using events may be good idea but it has the same issue.
>
>I have about 150 possible entities.
>In UI layer I have some static generic methods which take entity as generic type parameter and creates UI form for edit this type of entity.
>
>How to pass this method and entity type from business layer to this form using events ?

Can you show a little code sample of what you are trying to do. Creating an event in the business layer and passing the entity type in the args would be pretty straight forward. Having your UI register as a listener with a handler method could receive the entity type and cast from a base entity class. Since you have this many possible entities, one commonly used method is to have a class table to define which form class to instanitate based on the passed entity. Assuming I understand your question. A little more description or code would be helpful.

The things I don't know about your question are: Does this entity object already have data involved or are we just talking about determining the type of entity? Are there more than a single form for a given entity? You mention you have a static FormGenerator method, does this already know of the different types of forms? If so based on what?

Are you comfortable with creating Events?

I am sure there are many ways to do this but having your business layer involved in creating forms seems to defeat the purpose of having your business layer separate and would couple the two pretty tight.
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform