tags:

views:

78

answers:

1

Lets say I have 3 Widget automated factories: FactoryA, FactoryB, and FactoryC. I am to develop and maintain a .Net application that facilitates the automation of these factories (motion control, mechanical positioning, etc.).

This application must have the same interface for the 3 factories, but these factories are vastly different in their operation and physical layout. They generally follow the same program flow: Step1, Step2, Step3, Step4. But these Steps across the each factory differ by as much as they have in common. So logically I must break things down into even more steps. I want to be able to update each factory without risking breaking anything. Each Factory also has different database requirements, where I have to write custom records that constantly change.

So how should I lay the core functionality out, at a high level?

Currenly I have something like this:

FactoryA: Input->ProcessA.dll->Output
FactoryB: Input->ProcessB.dll->Output
FactoryC: ...

This method doesn't maintain well for obvious reasons. But at least all the different Steps are highly customized.

Would I be better of having a single Process DLL, and store in a config file the required Steps to achieve the desired output? In other words, if each Factory uses a random 100 of 500 Steps (methods, exaggerating here) from the same DLL, how should I store the sequence needed for each Factory?

This question is very open ended. If this program is good enough, maybe there will be 1000 Factories that it must handle someday. I want to add features to make it neat but can't risk the basic operation breaking.

What are your thoughts?

+1  A: 

Without really knowing more, it sounds more like you want a builder pattern than factories.

http://en.wikipedia.org/wiki/Builder_pattern

Edit: Perhaps a better answer is to take look at one of the IVC frameworks (e.g., Spring.NET) and see if that'll make it easier for you to construct your objects (and make code more maintainable).

Assuming it's ok to use a framework, of course.

hythlodayr
This gives me (a relatively new programmer) something to build from. Thank you!
bufferz