重用Orchard的Core构建另一个可扩展性框架
我非常渴望听到对此的意见。
我们正在为 Web 应用程序构建可扩展的架构。我们有一个构建默认产品的核心团队。其他开发团队采用默认产品,并希望在代码级别覆盖/替换/扩展其功能。
我们正在考虑使用 Orchard 的 Core 来实现这一目标。
如果我们这样做,可能会包括:
从 Orchard 中删除所有与 CMS 相关的内容 剥离 Orchard 的数据库 使用/构建 Orchard 的核心 DLL 来创建我们需要的可扩展功能 一种替代方案是普通的 ASP.NET MVC 可扩展性。
意见?
I am very keen to hear opinions on this.
We are building an extensible architecture for web applications. We have a core team that builds the default product. Other dev teams take the default product and want to override/replace/extend its functionality at the code level.
We are considering using Orchard's Core to achieve this.
If we did it would probably consist of:
Removing everything CMS related from Orchard
Stripping out Orchard's database
Using/building on Orchard's core DLLs to create the extensible capabilities we require
One alternative to this is vanilla ASP.NET MVC extensibility.
Opinions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们在 ITV 采取了类似的方法,我们决定要迁移到一个新系统,并想要 Orchard 具有的许多功能,但我们不需要全部……即 CMS 部分。
我们将 Orchard.Web 作为我们所有“区域/模块”的主机 - 这非常重要,因为它迫使开发人员考虑松散地耦合他们的组件。
然后我们决定采用该框架并剔除其中的某些方面。在框架中,我们采用了日志记录、缓存以及围绕 IDependency 的 DI 内容。最难的部分是 Autofac。请花点时间解决这个问题,因为我认为我们的实现并不是最好的,而且我确信其中存在错误。我们采用了大量 Orchard DI 代码,并尝试在不使用所有 shell 的情况下对其进行改造。
We took a similar approach at ITV, we decided that we wanted to move to a new system and wanted a lot of functionality that Orchard has, but we don't need it all... i.e. the CMS part of things.
We took Orchard.Web as the host for all our 'areas/modules' - This is really important, as it forces developers to think about loosely coupling their components.
We then decided to take the framework and strip out certain aspects of it. In the framework we took Logging, Caching, and the DI stuff around IDependency. The hardest part was Autofac. Take your time around this as our implementation I think, was not the best and I am sure there are bugs in it. We took a lot of the Orchard DI code and tried to retrofit that it without all the shell stuff.
Orchard 被称为 CMS,但它的功能肯定远不止于此。它非常通用,可为您提供许多开箱即用的非 CMS 功能。例如,它可以使用模块轻松扩展 - 这对于构建框架应用程序非常有用。此外,Orchard 不会阻止您使用常规 ASP.NET MVC。如果您在 Orchard 中找不到所需的内容,您可以添加常规控制器并在 vanilla MVC 中实现应用程序的部分内容。最后,该框架本身具有很强的可扩展性,如果需要,通常可以覆盖其中的每个机制。
另一方面,Orchard 一开始学习起来有点困难。没有太多的文档,框架中有很多“魔力”。有时很难弄清楚如何实现某些特定功能。至少这是我的印象。但是,社区非常有帮助,通常您可以找到人来帮助您。当你熟悉了 Orchard 后,它就是一个很棒的框架。
因此,就您的情况而言,我认为值得一试。
Orchard is called a CMS, but it is certainly a lot more than that. It is very generic and gives you a lot of non-CMS functionality out-of-the box. For example, it can be easily extended using modules - this is great for building framework applications. Additionally, Orchard doesn't stop you from using regular ASP.NET MVC. You can add regular controllers and implement parts of your application in vanilla MVC if you can't find what you need in Orchard. Finally, the framework is very extensible itself and it's usually possible to override every single mechanism in it if you need so.
On the other hand, Orchard is a little hard to learn at the beginning. There isn't too much documentation and there's a lot of "magic" in the framework. Sometimes it's difficult to figure out how to implement some specific functionality. At least that's my impression. However, the community is very helpful and usually you can find people to help you. After you get a hang of Orchard it's a great framework.
So in your case, I think it's well worth a try.
另一种可能更具实验性的方法是使用 Orchard 应用程序主机。
这个框架可以让你在任何应用程序中运行轻量级的 Orchard shell,因此本质上你可以在任何地方编写 Orchard 代码,让它成为一个控制台应用程序、一个云工作者甚至一个非 Orchard Web 应用程序(尽管后者会有点无意义)。
此外,Orchard App Host 正是您想要实现的目标的一个示例:将 Orchard 剥离到其核心并将其用作通用应用程序框架。它可以以相当干净的方式实现(无需对 Orchard 进行修改),但相当复杂。如果没有更好地理解您的用例,我怀疑您是否想推出类似的东西。
您基本上可以从 Orchard 解决方案中删除每个模块,甚至是核心模块(如果您愿意冒险并从那里开始构建):这可能是最简单的。然而,自然地,这也意味着一旦您尝试使用裸核心之外的任何内容,您将不得不重新实现 Orchard 中已有的内容。
Another, probably more experimental approach would be to use Orchard Application Host.
This framework lets you run light-weight Orchard shells inside any application, thus essentially you can write Orchard code anywhere, let it be a console app, a cloud worker or even a non-Orchard web app (though the latter one would be a bit pointless).
Furthermore Orchard App Host is an example of exactly what you want to achieve: stripping down Orchard to its core and use it as a generic application framework. It's possible in a fairly clean way (without modifications to Orchard) but quite complex. Without better understanding your use-case I doubt you want to roll out something similar.
You can basically remove every module from the Orchard solution, even the Core module if you fee adventurous and start to build from there: this is probably the easiest. However, naturally, this also means that once you try to use anything not in the bare core you'll have to re-implement stuff that's already in Orchard.