Plugin's

Posts   
 
    
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 31-Mar-2005 07:18:51   

I am just curious, but have any of you created an application that utilized plugin's with LLBLGen? Do you pass the entity directly? or create some other object?

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 01-Apr-2005 02:47:25   

Not sure if this will help your delimma, but IMO plugin frameworks and LLBLGen entities arent really related are they....

Normally when I write a plugin, all of the code is self contained in the plugin. I create an attribute or some other hook, so that the host can locate the plugin assembly at runtime, then I allow the plugin to register with the main applications menu. When the user interacts with the menu, control is transferred to the forms in the plugin.

In my scenarios, plugins are simply dlls with forms that use some part of the services layer and yes they typically know about llblgen entities.

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 01-Apr-2005 05:18:36   

Ok, so like you would just pass an order entity with all order detail enties into the plugin?

So say your pluging had to implment some Interface called IOrder and in IOrder you had a function called

OnOrderComplete(orderentity order)

You would do something on similar to that? Have u experienced any problems with doing this?

Thanks for your help!

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 01-Apr-2005 13:35:49   

Yes, that is what I would personally do. Some people run prefer to remove references to llblgen runtimes but I just consider the runtimes as a dependency of my applications, so I dont have any issues with that approach.

As for issues, I havent run across any, but I use the adapter pattern mostly, so the entity classes dont contain any implementation code like the self serviceing classes do. So there typically isnt any worry about passing them around between processes or other dlls.

You might onsider making your interfaace more generic, just in case you ever need to change the type of object passed to the OnOrderComplete method, i.e. OnOrderComplete(IEntiy2 orderEntity) or OnOrderComplete(EntityBase2 orderEntity).

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 01-Apr-2005 18:04:44   

Ahh good point about making it more generic! Only u would loose your strong typedness (is that a word? hehe )

Normally i pass around the adapter entities also. My concern was that for a customer to write a plugin the LLBLGen entity can be kinda confusing since its got a bunch of other stufff besides just the data ( ie, other function/properties besides just strict data, if u get what i mean )

But i guess in reality its really no more confusing then a dataset, except a dataset everyone knows wink

Skeeterbug
User
Posts: 165
Joined: 21-May-2004
# Posted on: 04-Apr-2005 13:41:58   

Devildog74 wrote:

You might onsider making your interfaace more generic, just in case you ever need to change the type of object passed to the OnOrderComplete method, i.e. OnOrderComplete(IEntiy2 orderEntity) or OnOrderComplete(EntityBase2 orderEntity).

Answer wrote:

Ahh good point about making it more generic! Only u would loose your strong typedness (is that a word? hehe )

IEntity2 can be "unboxed" to an OrderEntity on the client so you won't lose your typed features.

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 04-Apr-2005 17:53:39   

True

I can see why you might want the generic object to be passed in as it helps with maintence. But it might make it abit more difficult for teh client as they don't know exactly whats being passed in. Assuming you dont have good docs.

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 05-Apr-2005 03:07:45   

The parameter name "orderEntity" should be self explanitory and self documenting.