具有多个模块和模块的 Prism 取决于

发布于 2024-08-24 18:31:09 字数 337 浏览 3 评论 0原文

您好,我在一个场景中,我正在考虑拥有多个模块,并让模块依赖于其他模块。

假设我们正在构建一个业务系统,其中一部分是进销存,并且我们在不同的分支机构都有客户。

因此,一个行业可能希望使用某些工具并以自己的方式创建发票,而另一个行业可能希望以另一种方式进行。因此,我认为我们可以为每个创建发票方法执行一个模块,这样当应用程序加载时,我们可以在配置中看到必须加载板条箱发票模块的哪个模块。

那么对于我的第一个问题,这是解决这个问题的方法还是有更好的解决方案?

我的下一个问题是我应该把它们放在树上的哪里?

依赖于Invoicing模块的模块应该放在Invoicing模块下还是同一级别?

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 crate 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我早已燃尽 2024-08-31 18:31:10

我首先会创建一个视图引擎来根据上下文标准加载视图。
标准可以是租户(域名)、设备、视图大小、当前主题(视图引擎依赖的所有这些接口),

也许使用像 DataTemplateSelector 这样的方法分散在需要自定义的视图中。您可能希望像在 asp.net mvc 中一样处理它,以根据视图搜索路径解析视图(以便您能够覆盖视图)。

您需要能够加载应用程序资源租户样式以进行自定义品牌。

我会推迟创建细粒度依赖项,直到上述内容开始显示维护问题之后。对于需要定制的业务逻辑,您可以使用策略模式。

我发现现在要打破它并且必须管理这些长依赖链需要更多的前期成本。稍后实施的成本(在良好的业务功能需要它之后)将只需要使用 ModuleInfo 几个小时的工作,如下所述:
Silverlight PRISM 创建自定义模块目录

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

北方的巷 2024-08-31 18:31:10

我们选择使用模块,我将它们放在树中的依赖模块下。
效果真的很棒。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文