带有 Play 框架的 Java EE 架构 [英] Java EE architecture with Play Framework

查看:21
本文介绍了带有 Play 框架的 Java EE 架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Play 重现 Java EE 架构?我所说的 Java EE 是指这 4 层:视图、控制器、服务、模型.

Is it possible to reproduce a Java EE architecture with Play? By Java EE I mean these 4 layers: view, controller, service, model.

我知道 play 只使用基于 MVC 的更好的架构,我喜欢这个架构,但我必须为特定项目使用 Java EE 架构,我想使用 Play,因为它是我认为最好的 Java 框架的观点.

I know play use a better architecture only based on MVC, and I love this one, but I must use a Java EE architecture for a specific project and I'd like to use Play considering it's the best Java framework from my point of view.

推荐答案

您可以使用 spring 模块将 spring 与 play 集成并将其用于服务/模型层:http://www.playframework.org/modules/spring

You can use spring module to integrates spring with play and use it for the service/model layers : http://www.playframework.org/modules/spring

或者您可以简单地在控制器和模型之间创建一个服务层,并自己使用一些模式(单例、工厂等)将这些服务与控制器连接起来

Or you can simply create a Service layer between Controllers and Model and use some patterns by yourself (singleton, factory, ...) to wire controllers with these services

这篇关于带有 Play 框架的 Java EE 架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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