|
-
Dec 8th, 2014, 12:38 PM
#1
Constructor constrictor
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?
-
Dec 15th, 2014, 06:00 AM
#2
Re: Constructor constrictor
To properly work in a plugin manner surely you use Dependency Injection, have you ever used that design pattern before Merrion?
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
-
Dec 15th, 2014, 09:11 AM
#3
Re: Constructor constrictor
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|