为网络开发选择一个好的框架 [英] Selecting a good Framework for web-development

查看:169
本文介绍了为网络开发选择一个好的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据已接受的此问题的答案,我已经设置了NetBeans /tomcat环境. 在测试此设置时,我试图创建一个Java Web/Web应用程序,但是为该测试应用程序选择的框架感到困惑.

选择是:

  • Spring Web MVC 2.5
  • JavaServer Faces
  • Struts 1.3.8
  • 休眠3.2.5

在我的阅读过程中(搜寻& SO),很快迷失在树林中,所以我正在考虑只选一个,如果没有成功,以后再切换/迁移到另一个.这样的方法可行吗?


项目背景

(由于遗留代码,必须基于Java)
它使用自签名的applet进行客户端渲染.互动;
Servlet检索从客户端请求的数据集;
数据库可能位于某个远程服务器上,因此我打算使用JDBC来访问它;

原有系统是基于CORBA(ACE/TAO)的系统,其中有许多C ++模块需要转换为Java,而进行CORBA调用的现有Java模块(幸运的是很少)需要更改为使用新翻译的Java-模块.

如果您能提出更好的方法来处理该项目,请告诉我.

(该项目具有我所喜欢的所有特征:它有趣,具有挑战性,并且我学到一些新东西)

解决方案

首先,仔细研究整个 Spring框架. 文档很好,它是从一个非常基本的模块开始的到达Web MVC层的方式(您可以在其中决定是否要使用它,例如,也可以进行Struts集成-但无论如何,我发现Struts总是很麻烦). Hibernate是最流行的对象关系映射器框架.它用于存储,查询和检索域模型对象(要存储在数据库中的所有内容),但与Web层无关.

我个人不喜欢JSF(另一个规范怪兽要花很多时间才能投入使用).如果您喜欢基于窗口小部件的方法(将页面与组件一起使用,而不是输出普通的旧HTML),则可能需要查看 GRails .使用它真的很有趣,即使您必须学习另一种(脚本)语言(称为Groovy),您仍然可以在Framework中使用所有Java旧类,因为Groovy类与Java类兼容(反之亦然).

顺便说一句.我认为CORBA是一种技术/协议/标准,尤其允许您独立于语言访问方法和对象.维基百科:

公共对象请求代理 架构(CORBA)是标准 由对象管理组定义 (OMG),可启用软件组件 用多种计算机语言编写 并在多台计算机上运行 一起工作,即它支持 多个平台.

那为什么要翻译C ++模块才能与Java对话呢?

Based the accepted answer to this question I've setup a NetBeans/tomcat environment. In testing this setup I'm trying to create a Java Web/Web application, but is stumped by the a choice of frameworks for this test-app.

The choices are:

  • Spring Web MVC 2.5
  • JavaServer Faces
  • Struts 1.3.8
  • Hibernate 3.2.5

In my reading-up (googling & SO) and fairly quickly got lost in the woods, so I am considering just picking one and if it doesn't pan out, to later switch/migrate to a different one. Would such an approach be feasible?


Background on the project

(Must be Java-based due to legacy code)
It uses a self-signed applet to do client-side rendering & interaction;
Servlets retrieve data-sets requested from the client;
Database may be on some remote server, so I intend to use JDBC for accessing it;

The legacy system was CORBA (ACE/TAO) based with lots of C++ modules that need to be translated to Java, and the existing Java-modules (fortunately few) that make CORBA-calls need to be changed to use the newly translated Java-modules.

If you can come up with better approach to handle this project, please tell me.

(This project has all the hallmarks of what I like: it is interesting, challenging, and I learn something new)

解决方案

Well first of all it can't hurt to take a close look at the whole Spring Framework in general. The documentation is quite good starting at the very basic module working it's way up to the web MVC layer (where you can decide if you want to use it, e.g. Struts Integration is possible, too - but I found Struts always to be a hassle anyway). Hibernate is the probably most popular Object Relation Mapper framework. It is used to store, query and retrieve you Domain Model Objects (everything that you want to store in the database) but doesn't have anything to do with the web layer.

I personally don't like JSF (another specification monster that takes way more time to get into it than it needs to). If you favour a widget based approach (putting you page together with componentes instead of outputting plain old HTML) you might want to have a look at Google Web Toolkit.

Another Spring sollution is GRails. It is really fun to use and even if you have to learn another (scripting) language (called Groovy) you can still use all your Java legacy classe in the Framework because Groovy classes are compatible with Java classes (and vice versa).

And btw. I thought that CORBA is a technology / protocol / standard that especially allows you to access methods and objects independently of the language. Wikipedia:

The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) that enables software components written in multiple computer languages and running on multiple computers to work together, i.e. it supports multiple platforms.

So why do you have to translate the C++ modules to talk to Java?

这篇关于为网络开发选择一个好的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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