Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Constructor constrictor

Merrion

PowerPoster
Joined
Jul 26, 2002
Messages
2,148
I have a bunch of classes that are designed to basically test some parameters and tell me if the thing they represent is complete or not yet. For example the "DownloadTester" will be passed a filename and size will check if the file exists and is the given size, and the "EmailTester" will take an email address and subject and check if such an email has been received etc.

I'd like to have a generic constructor that takes an array of parameters so I can do this in a plug-in manner. What is the best way of doing this given an interface cannot specify anything about a class constructor?
 

NeedSomeAnswers

Superbly Moderated
Joined
Jun 4, 2002
Messages
2,610
To properly work in a plugin manner surely you use Dependency Injection, have you ever used that design pattern before Merrion?
 

Merrion

PowerPoster
Joined
Jul 26, 2002
Messages
2,148
Yeah - I guess DI will work in this case. I need to turn the array of parameters into a more meaningful class so the mapper can find what to instantiate...
 
Top