简体   繁体   English

应用架构设计问题

[英]Application Architecture Design Question

I need your suggestions in designing a Java/J2EE web based application. 在设计基于Java / J2EE Web的应用程序时,我需要您的建议。 Here are its characteristics: 以下是它的特点:

  1. Purely database oriented application (with 10 tables). 纯粹面向数据库的应用程序(具有10个表)。 The database is Oracle. 数据库是Oracle。
  2. Three different types of interfaces/screens: 2.1 WebSphere Portlets (6 Interfaces/Screens) 2.2 Handheld Device (5 Interfaces/Screens) 2.3 Web Application (17 Interfaces/Screens) 三种不同类型的接口/屏幕:2.1 WebSphere Portlets(6个接口/屏幕)2.2手持设备(5个接口/屏幕)2.3 Web应用程序(17个接口/屏幕)
  3. Few of the screens are just report which will be built using Crystal Reports. 很少有屏幕只是使用Crystal Reports构建的报告。
  4. There isn't much business logic involved. 涉及的业务逻辑不多。

Now my concerns are: 现在我担心的是:

  1. Which architecture should I go for 2 tier or 3 tier? 我应该采用2层还是3层的哪种架构?
  2. Which frameworks should I use struts/jsf (MVC)? 我应该使用哪些框架struts / jsf(MVC)? If any? 如果有的话? Or should I go for simple POJO based programming without any framework. 或者我应该在没有任何框架的情况下进行简单的基于POJO的编程。
  3. The biggest concern is packaging, I mean I don't want to replicate the business and database layer for each three different types of interfaces I want to develop. 最大的问题是打包,我的意思是我不想为我想要开发的每种三种不同类型的接口复制业务和数据库层。 Do you think EJB will be good option to expose DB/Business layer? 您认为EJB是公开DB / Business层的好选择吗? How should I handle this? 我该怎么处理?
  4. Should I use any specific framework like sitemash for presentation layer? 我是否应该将任何特定的框架(如sitemash)用于表示层?
  5. Should I use any specific framework for database layer JPA/Hibernate or should I use simple JDBC? 我应该使用任何特定的数据库层JPA / Hibernate框架,还是应该使用简单的JDBC?

Any comments/suggestions are welcome... 欢迎任何意见/建议...

BR SC BR SC

Which architecture should I go for 2 tier or 3 tier? 我应该采用2层还是3层的哪种架构?

Three tier: view, service, and persistence. 三层:视图,服务和持久性。

Which frameworks should I use struts/jsf (MVC)? 我应该使用哪些框架struts / jsf(MVC)? If any? 如果有的话? Or should I go for simple POJO based programming without any framework. 或者我应该在没有任何框架的情况下进行简单的基于POJO的编程。

Struts? Struts的? No. JSF? 不是JSF? No. I'd recommend Spring, since it supports both web and portal MVC and contract-first web services. 不。我建议使用Spring,因为它同时支持Web和门户MVC以及合同优先的Web服务。

The biggest concern is packaging, I mean I don't want to replicate the business and database layer for each three different types of interfaces I want to develop. 最大的问题是打包,我的意思是我不想为我想要开发的每种三种不同类型的接口复制业务和数据库层。 Do you think EJB will be good option to expose DB/Business layer? 您认为EJB是公开DB / Business层的好选择吗? How should I handle this? 我该怎么处理?

I wouldn't recommend EJB. 我不推荐EJB。 I'd suggest HTTP based web services for remoting. 我建议使用基于HTTP的Web服务进行远程处理。

Should I use any specific framework like sitemash for presentation layer? 我是否应该将任何特定的框架(如sitemash)用于表示层?

Sitemesh is fine, but it's not a presentation layer. Sitemesh很好,但它不是表示层。

I'd use Velocity templates to generate straight HTML that I'd send back to clients. 我将使用Velocity模板生成直接HTML,然后将其发送回客户端。

Should I use any specific framework for database layer JPA/Hibernate or should I use simple JDBC? 我应该使用任何特定的数据库层JPA / Hibernate框架,还是应该使用简单的JDBC?

Ten tables? 十张桌子? That schema is small enough where JPA and Hibernate seem like overkill to me. 那个模式足够小,JPA和Hibernate看起来对我来说太过分了。 Create a POJO interface for your persistence layer and you can isolate the implementation from clients. 为持久层创建POJO接口,您可以将实现与客户端隔离。 Start simple and switch it if you decide you need to or want to. 如果您决定需要或想要,请从简单开始并切换它。

I think first answer has good baseline. 我认为第一个答案有良好的基线。 I would echo most of the sentiments, but would additionally recommend jDBI for database access (see this tutorial ); 我会回应大多数情绪,但还会建议使用jDBI进行数据库访问(参见本教程 ); it nicely simplifies handling compared to 'raw' JDBC, but without requiring any mapping. 与“原始”JDBC相比,它很好地简化了处理,但不需要任何映射。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM