商业网站应用平台结构 [英] Business web application platform structure

查看:79
本文介绍了商业网站应用平台结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Java/Spring/Hibernate开发一个Web应用程序,作为一个我可以将插件连接到的业务平台(即CRM插件,商品插件,销售插件).这些插件可以树的方式依赖于其他插件.父项目将打包为 war ,具有所有基本配置和外观(Spring配置,CSS,脚本),随时可用的用户和组管理,安全设置等.

I would like to develop a web application in Java/Spring/Hibernate serving as a business platform that I could connect plugins to (i.e. CRM plugin, ware plugin, sales plugin). Those plugins could be dependent on other plugins in a tree manner. The parent project would be packaged as war having all the basic configuration and looks (Spring configs, CSS, scripts), ready-to-go user and group management, security settings, etc.

总的来说,我希望它的行为和外观看起来像Joomla,但是可以使用不同的工具来实现不同的目的.关于这个项目,我有几个问题:

Altogether, I would like it to behave and look a bit like Joomla, but be built using different tools for different purposes. And I have a few questions concerning that project:

  1. 您是否知道有任何开源项目可以提供这样的平台?
  2. 如果不是,那么Maven是否适用于管理那些插件?
  3. 打包和部署这些插件的最佳方法是什么?

最后但并非最不重要的一点是,这是正确的方法,还是死路一条?为满足这些业务需求而创建一个单独的Web应用程序会更好吗?

And last but not least, is this the right way to go, or is it a dead end? Would it be better to create a separate web app for those business needs?

推荐答案

有很多构建插件模块的方法. 一些想法:

There are lots of ways to build plugin modules. Some Ideas:

您可以将每个插件模块打包为一个jar,并在此jar的classpath根目录中,放置一个带有beans配置的spring config文件,因此,如果使用的是特定插件.您可以通过简单地将此文件添加到web.xml中的contextConfigLocation参数来打开"该程序包的Bean:

You could package every plugin module as a jar and in the classpath root of this jar, put a spring config file with the beans configuration, so if when you are using a specific plugin. You can "turn on" the beans of this package on a web application by simply adding this file to the contextConfigLocation parameter in your web.xml:

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath:module1.xml
        classpath:module2.xml
        classpath:module3.xml
        classpath:module4.xml
    </param-value>
</context-param>

因此,您可以在Web应用程序中使用这些bean.这样做的另一种方法是使用更多注释驱动的方法.或者您可以混合使用这些方法.

So you are able to use those beans in your web application. Another way of doing this, would be to use a more annotations driven approach. Or you can mix the methods.

前一段时间,我构造了一种方法,该方法通过检测类路径中特定抽象类(协定)的所有实现来自动对桌面应用程序中的插件进行热检测(在执行时,而无需重新启动应用程序).因此,构建新插件所需要做的就是实现此合同".我已经使用一些类加载器"的东西来做到这一点.

Some time ago, I structured a way to automatically hot-detect (in execution time, without having to restart the application) plugins in a desktop application by detecting all implementations of a specific abstract class (a contract) in the classpath. So, all that I had to do to build a new plugin, was to implement this "contract". I've used some "classloader" goodies to do this.

在谈论模块"时,您可能希望了解有关 OSGi

When talking about "modules" maybe you would like to see something about OSGi

嗯...这些是一些想法.我希望它能以任何方式提供帮助. ;-)

Well... those are some ideas. I hope it helps in any way. ;-)

这篇关于商业网站应用平台结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆