开发者

Prism with multiple Modules and Modules depends on

Hi I'm in a scenario where I'm thinking about to have several modules, and let modules depends on other modules.

say that we are building a business system while one part is invoicing and we have customers in different branches.

So one industry may want to use some tools and create the invoice in their way, and another industry may want to do it in another way. So I think we can do one module per create invoice method so when the application loads we can see in the configuration what module of the crat开发者_开发知识库e invoices module who have to load.

So to my first question, is this the way to solve this problem or are there more better solutions?

My next question is where should I put them in a tree?

Should the modules that depends upon Invoicing module be put under the Invoicing module or the same level?


I would first work on creating a viewengine to load view based on context criteria. The criteria can be tenant (domain name), device, view size, current theme (all of these interfaces your viewengine depends on)

Maybe using an approach like DataTemplateSelector scattered across your views needing customization. You would probably want to approach it like in asp.net mvc to resolve the views (so you have the ability to override views) based on view search paths.

You would need to be able to load into app resources tenant styles for custom branding.

I would push back in creating your fine grain dependencies until after the above begins to show maintenance problems. For business logic that needs customization you can use a strategy pattern.

I see it costing more upfront to break it out now and having to manage these long dependency chains. The cost to implement later (after a good business feature requires it) will only take a few hours of work using ModuleInfo as explained here: Silverlight PRISM Creating a custom module catalog


We choosed to go with modules, and I put them under the depending module in the tree. It worked really great.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜