MEF for dynamic load of process definitions
We have an application comprised of several parts:
- ModelBuilder: domain model that allows the building of ProcessDefinitions (Activities, gateways, events, etc.) and Tasks.
- Concrete ProcessDefinitions: collections of ProcessDefinitions that solve certain business. Each assembly contains a collection of concrete ProcessDefinitions, Tasks, etc.
- Runtime: we would like it to load dynamically the assemblies containing Concrete ProcessDefinitions and be able to find them through a simple service, FindProcessDefinition(proceedingId,versionPolicy), which would look in all the Concrete ProcessDefinition parts. ProcessDefinition must be cached/singleton.
Do you think MEF could be the way to go with this problem? I have seen examples of MEF but they are used to implement interfaces, not for this "build" pattern.
Any hint of how to do it? Any other alternative? Thanks.