How to use design pattern for calling multiple assemblies
-
Hello, I have a project which uses various different assmeblies for each task for example: Crop pdf - assembly Write Word - assembly Create excel and convert to HTML - assembly Now there can be n number of assemblies which will be used based on some condition. I have two questions as below: What kind of pattern will be best suited for this? How can I make sure that the code written by each individual for each assembly do not have a common code in place.
Regards, Pavas
-
Hello, I have a project which uses various different assmeblies for each task for example: Crop pdf - assembly Write Word - assembly Create excel and convert to HTML - assembly Now there can be n number of assemblies which will be used based on some condition. I have two questions as below: What kind of pattern will be best suited for this? How can I make sure that the code written by each individual for each assembly do not have a common code in place.
Regards, Pavas
mpavas wrote:
What kind of pattern will be best suited for this?
Create a common interface which all your assemblies has to implement. You can use Factory pattern and return the interface instance. pseudo code follows
Interface ITask{
void DoTask();
}ITask task = TaskFactory.GetTask(TaskIdentifier)
task.DoTask()TaskFactory.GetTask
will check the conditions and load relevant assemblies using reflection and return it's instance.mpavas wrote:
How can I make sure that the code written by each individual for each assembly do not have a common code in place.
This is not clear. Can you explain?
Navaneeth How to use google | Ask smart questions
-
mpavas wrote:
What kind of pattern will be best suited for this?
Create a common interface which all your assemblies has to implement. You can use Factory pattern and return the interface instance. pseudo code follows
Interface ITask{
void DoTask();
}ITask task = TaskFactory.GetTask(TaskIdentifier)
task.DoTask()TaskFactory.GetTask
will check the conditions and load relevant assemblies using reflection and return it's instance.mpavas wrote:
How can I make sure that the code written by each individual for each assembly do not have a common code in place.
This is not clear. Can you explain?
Navaneeth How to use google | Ask smart questions
Thanks, The last question was: There are 10 developers writing different assemblies. Now how can we make sure they do not use duplicate codes.. I guess we need to fist list out all the different methods hence we can re-use them. Thanks for the suggestion
Regards, Pavas
-
Thanks, The last question was: There are 10 developers writing different assemblies. Now how can we make sure they do not use duplicate codes.. I guess we need to fist list out all the different methods hence we can re-use them. Thanks for the suggestion
Regards, Pavas
mpavas wrote:
Now how can we make sure they do not use duplicate codes
What do you mean by duplicate code? You should conduct meetings with the team members and decide how each one has to code. Peer reviews also will work.
Navaneeth How to use google | Ask smart questions
-
mpavas wrote:
Now how can we make sure they do not use duplicate codes
What do you mean by duplicate code? You should conduct meetings with the team members and decide how each one has to code. Peer reviews also will work.
Navaneeth How to use google | Ask smart questions