构建大型 Liferay portlet 项目

发布于 2024-11-06 03:48:21 字数 1150 浏览 5 评论 0原文

我们正在开始使用 Liferay 进行大型 Portlet 开发工作,我发现很难根据我们正在创建的各种 Portlet 来构建该项目。我们不确定应该以哪种方式构建我们的项目。我们的开发团队分布在世界各地,我们使用 git 作为我们的版本存储库。我们使用 Spring Portlet MVC 来开发 portlet,并使用服务构建器来构建服务层。

我可以考虑这三种方法。

  1. 为每个 Portlet 创建一个新的 Portlet 项目

    • 将每个 Portlet 保留在单独的 Portlet 项目中可以轻松快速地进行开发,因为我可以让开发人员独立处理它们。
    • 当 portlet 使用公共代码时,这可能会变得很痛苦。因此,不同 portlet 中可能会出现大量相同类型的代码。
    • 这可能会失控,因为我们将拥有许多 war 文件,并且每个文件都会增加我们的运行时成本。
  2. 逻辑上将 portlet 分成多个 portlet 项目

    • 这将减少 portlet 项目的数量,并且可以重用大量代码。
    • 可以在这样的结构中放置一些控件。
  3. 只创建一个包含所有 portlet 的 portlet 项目

    • 这对于分布式开发团队来说管理起来最为复杂。
    • 大多数通用代码都可以重用。
    • 这样可以更轻松地实现一致性。
  4. 1 和 2 的混合(基于我在下面的评论中与 Dirk 的讨论) 我猜这种方法需要结合 1 和 2。

    • 我想为每个开发人员提供一个独立的 portlet 开发环境以及一些关于通用组件的指南。
    • 这样他们就可以更好地控制自己的 portlet 代码,并且只关注 portlet 特定的代码。
    • 同时,公共代码可能需要更多的控制,因为多人可能会修改它。

如果您已经创建了 liferay 项目/portlet,我想知道您的专家意见以及您选择的方法。记住这些事情

  • 当不同的开发人员开发多个 Portlet 时,如何控制 Portlet 开发。
  • 上述任何方法的优点/缺点是什么?
  • 如果上述方法都不好,请提及您能想到的最佳方法。

感谢您的阅读

We are starting some work on a large a portlet development work using Liferay and I am finding it difficult to structure this project in terms of various portlets we are creating. We are not sure which way should we structure our project. We have distributed development team across world and we are using git as our version repository. We are using Spring Portlet MVC for developing portlets and using service builder for service layer.

I can think about these 3 approaches.

  1. Create a New Portlet project for each portlet

    • Keeping each portlet in a separate portlet project can be easy and fast in development since I can have developers independently working on them.
    • This may become pain in cases when portlets use common code. So there can be lot of proliferation of same type of code in different portlets.
    • This may go out of control since we will have many war files and each add to runtime cost of us.
  2. Logically separate portlets into number of portlet projects

    • This will reduce the number of portlet projects and lot of code can be reused.
    • Some control can be placed in such structure.
  3. Create just one portlet project with all portlets

    • This will be most complicated to manage for distributed developer team.
    • Most of common code can be reused.
    • Enforcing consistency can be easier in this.
  4. Mix of 1 and 2 (Based on my discussion with Dirk in comments below)
    This approach needs to be mix of 1 and 2 I guess.

    • I would want to give each developer a independent portlet dev env along with some guidelines on common components.
    • This way they have more control on their portlet code and only focus on portlet specific code.
    • At the same time common code may need to have more control since multiple people may modify it.

I would like to know your expert opinion if you have already created liferay projects/portlets and what approach you chose. Keeping these things in mind

  • How do you control the portlet development when there are multiple portlets being developed by variety of developers.
  • What are pros/cons of any of the above approaches above mentioned.
  • If none of the above mentioned approaches are good please mention the best approach to this you can think of.

Thanks for reading

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

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

发布评论

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

评论(2

木有鱼丸 2024-11-13 03:48:21

在 Dirk 的答案中添加一些内容,我的经验法则是在同一个项目中拥有具有类似维护周期的 portlet - 例如,如果您更新其中一个,通常会更新所有它们,因为它们创建一个应用程序,通过以下方式呈现相同的数据不同的用户界面。这基本上就是你的选项2。

除此之外,你把选项钉得很好——答案是“在中间”。平衡分离与应用程序服务器开销。使用上面的经验法则就可以了。

关于开发环境:每个开发人员都应该在自己的环境中工作,但是,通过版本控制,他们当然可以在相同的项目上工作。

Adding just something to Dirk's answer, my rule of thumb is to have portlets with a similar maintenance cycle in the same project - e.g. if you update one of them you typically update all of them, because they make an application, presenting the same data through different UIs. This is basically your option 2.

Other than that you nailed the options quite good - the answer is "in the middle". Balance separation with app-server overhead. Use the rule of thumb above and you're set.

With regards to development environments: Every developer should work on their own environment, however, through version control they can - of course - work on the same projects.

一生独一 2024-11-13 03:48:21

我认为这很大程度上取决于您实际构建的项目类型。您所谈论的 portlet 是封装功能意义上的 portlet 吗?并将如此使用(即最终作为 Liferay 中的 portlet)?在我看来,如果它们的功能不相交并且彼此不依赖,则应该将它们放在不同的项目中。

如果您有核心功能(例如持久层和相关逻辑或其他业务逻辑),您绝对应该尽可能地重用它。因此,我认为 (1) 不是一个好的解决方案,并且这种通用逻辑应该分组在一个单独的项目中,并且 portlet 本身依赖于此。

作为一般方法:让开发人员都可以访问所有(或大多数)项目会出现什么问题?公共代码可以被所有 portlet 重用,但每个人仍然必须只做他/她的部分。

I think it pretty much depends on what kind of project you are actually building. Are the portlets you are talking about portlets in the sense of encapsulated functionality and will be used as such (i.e. as portlet in Liferay finally)? Those should be put in different projects in my opinion if their functionality of those is disjoint and they don't depend on eachother.

If you have a core of functionality (e.g. persistence layer and associated logic or other business logic) you should definitely reuse this in as much as possible. Thus, I don't think (1) is a good solution and this common logic should be grouped in a seperate project for instance and the portlets themselves depend on this.

As a general approach: what would be the problem to let the developers all have access to all (or most) projects? The common code could be reused by all portlets and still everyone would have to only work on his/her part.

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