My MVC solution is built with a core and a client split to it. The core defines the majority of the application but each client has their own Controller assembly and Web project.
The client projects use resources to define:
- Text to be rendered on markup pages
- DisplayName attribute values on ViewModels
- Text for messages etc. in the controller
- etc.
The core u开发者_如何学Pythonses it to define:
- Exception messages
- Validation messages
- etc.
As there are resources that might only exist for certain clients I would like to have a set of resources purely for the client - (Resources.ClientName project)
Other resources, the ones used by the core, must be defined in an assembly in the core.
This would all work fine but the actual resource values across the board will vary from client to client as as the core resource project is in the core it cannot be changed independently (nor can core assemblies reference client resource projects).
Ideally I'd like to not embed the resources in an assembly so that these values can be changed on production without a reinstall.
I'm sure I'm going about this wrong, could anybody give me some guidance?
Create a factory to provider ResourceManager
and setup the factory in each client project to provide appropriate resource from current assembly.
BTW, If you do not want to use embedded resources, create your own ResourceManager
so it provide you resource from wherever you need and setup the factory in each client project.
精彩评论