Looking for a dll type solution

J

Jason

Greetings,

When my data is updated in my sql server database there are a number of jobs
that my current process performs that analyzes the new data. This only
happens once a day very early in the am.

When I want to add a new job I have to add new code to the current process.

You probably know where I'm going with this but what I would like to happen
would be to store the "jobs" info in a table on the database and have my
process read that table to determine what jobs to perform when and where the
dll is that contains the code to execute the job.

I think I'm looking at a strategy type pattern here but I'm not sure how to
get around the references I would need to add to the project. Is this a job
for reflection? I've only read a little about it but I think it might be
able to help.

Any thoughts?

thanks
 
D

David Browne

Jason said:
Greetings,

When my data is updated in my sql server database there are a number of
jobs that my current process performs that analyzes the new data. This
only happens once a day very early in the am.

When I want to add a new job I have to add new code to the current
process.

You probably know where I'm going with this but what I would like to
happen would be to store the "jobs" info in a table on the database and
have my process read that table to determine what jobs to perform when and
where the dll is that contains the code to execute the job.

I think I'm looking at a strategy type pattern here but I'm not sure how
to get around the references I would need to add to the project. Is this a
job for reflection? I've only read a little about it but I think it might
be able to help.

Any thoughts?

Basic steps:

1)Define an interface that each of your plugins will implement.

2) Code your shell program to load a list of types given the assembly name
and type name.

3) For each loaded type,
-Create an instance of the type through reflection.
-Cast the instance to the interface type
-Operate the plugin through the interface

See

Let Users Add Functionality to Your .NET Applications with Macros and
Plug-Ins
http://msdn.microsoft.com/msdnmag/issues/03/10/Plug-Ins/default.aspx

Creating an Extensible Windows Service - Part 2: Plug-In Development
http://www.15seconds.com/issue/021015.htm

David
 
J

Jason

David Browne said:
Basic steps:

1)Define an interface that each of your plugins will implement.

2) Code your shell program to load a list of types given the assembly name
and type name.

3) For each loaded type,
-Create an instance of the type through reflection.
-Cast the instance to the interface type
-Operate the plugin through the interface

See

Let Users Add Functionality to Your .NET Applications with Macros and
Plug-Ins
http://msdn.microsoft.com/msdnmag/issues/03/10/Plug-Ins/default.aspx

Creating an Extensible Windows Service - Part 2: Plug-In Development
http://www.15seconds.com/issue/021015.htm

David



Awesome Thanks !!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top