Java EE 5 开发环境

发布于 2024-08-15 05:45:29 字数 1049 浏览 2 评论 0 原文

我有一个客户,他已经在生产中拥有一些应用程序,因此已经就下一个项目的生产环境做出了一些决定:

  • Sun iPlanet 6.1 SP7 (w/ apache)
  • JDK 1.6
  • Oracle Weblogic 10 MP3
  • Oracle 10g
  • 1024 -bit SSL

他们还有一些针对 Web 应用程序的企业标准:

  • Tomcat
  • Struts
  • 与 Safari、Firefox、IE6、IE7 的兼容性

我还被告知该应用程序可能不需要完整的 Java EE 5 环境(可能只需要一个 Web 容器) ,但需要通过客户端 EJB 等与托管在单独的 weblogic 实例上的实例进行通信,并对其他企业服务执行各种 Web 服务调用。

我的任务是就这个新团队的开发和测试环境做出一些决定(规模很小,可能包括我在内的 2 到 3 个人,但可能会在未来几个月内扩大)。我想创建一个这样的环境,人们可以使用他们喜欢的 IDE,并在本地主机上获得良好的开发体验,但仍然可以顺利地在测试环境中进行部署,然后再部署到生产环境。我的想法是,在本地工作站上,http 没问题,但集成测试服务器应该看起来与生产服务器完全一样,并且所有流量都应该是 https,以确保我们能够准确描述产品的情况。

知道开发人员的本地工作站会有很大差异,并且可能在其本地工作站上运行 Mac OS X 10.6 (Snow Leopard) 或 Windows 7,但还需要指定一个通用的测试服务器:什么技术堆栈将为我们提供从本地开发、测试到生产的顺利路径?

编辑:抱歉,当我说技术堆栈时,我的意思是 Ant + JBoss + Tomcat + Oracle XE 与 Maven + Geronimo + Derby。基本上是我们需要在每台开发机器和测试服务器上安装的具体规范实现的列表,它为我们提供了灵活的开发环境,并平滑过渡到测试和生产环境。

EDIT2:可能值得一提的是,这个应用程序,如果它需要保留任何信息(我假设是这种情况),无论它是什么肯定不会很复杂。它很可能类似于基本的产品数据库。

I've got a client who already has some applications in production and therefore has already made some decisions about what their production environment will be for this next project:

  • Sun iPlanet 6.1 SP7 (w/ apache)
  • JDK 1.6
  • Oracle Weblogic 10 MP3
  • Oracle 10g
  • 1024-bit SSL

They also have some corporate standards for web apps:

  • Tomcat
  • Struts
  • Compatibility with Safari, Firefox, IE6, IE7

I'm also told that this app will likely not need a full on Java EE 5 environment (probably only a web container), but will need to communicate with one hosted on a separate weblogic instance via client EJB's etc as well as perform various web service calls to other corporate services.

I've been given the task to make some decisions about what our development and test environments will look like for this new team (small, probably 2 or 3 people including me, but may grow over the coming months). I want to create one where people can use the IDE they love and have a good development experience on localhost, but still have a smooth path to deployment in a test environment, and then again to the production environment. My thinking is that on local workstations http is fine but the integration test server should look exactly like the production server, and all traffic should be https to make sure we are getting an accurate portrayal of what prod will be.

Knowing that devs local workstations will be highly varied and may be running Mac OS X 10.6 (Snow Leopard) or Windows 7 on their local workstations, but a common test server would also need to be spec'd out: what technology stack would give us a nice smooth path from local development, through test, and into production?

EDIT: Sorry, when I say technology stack I mean for example Ant + JBoss + Tomcat + Oracle XE vs. Maven + Geronimo + Derby. Basically a list of the concrete specification implementations that we will need to install on each development machine and the test server that gives us a flexible dev environment, and a smooth transition to test and production environments.

EDIT2: It's probably worth mentioning that this app, if it needs to persist any information at all (which I am assuming will be the case), whatever it is will definitely not be complicated. In all likelihood it will be something akin to a rudimentary product database.

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

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

发布评论

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

评论(3

无力看清 2024-08-22 05:45:29

我会选择:

  1. Hudson 用于夜间构建(或每次签入)
  2. MercurialSubversion 用于源代码控制(在 Windows 和 Mac 上都很好用) )
  3. 春天,春天,春天。是的,我是认真的,Spring 解决的问题不仅仅是依赖注入;例如安全性、批处理、事务处理、系统集成。
  4. 用于 ORM 的 EclipseLink。它的许多高级功能(Hibernate 所缺乏的)常常拯救了我(比如不错的存储过程支持)。
  5. 轻量级容器,例如 Jetty、TomcatResin。如果你使用像 GeronimoJBoss 这样的缓慢缓慢的东西,你就会犯团队灭绝罪。
  6. DeltaWalker 用于合并/比较工具(同样适用于所有平台)。
  7. 如果您要使用高级数据库功能,请选择OracleXE(和SQLDeveloper)。两者都是不错的工具。如果没有,那么像 H2Derby 这样的轻量级内容就可以了。
  8. JUnit(或TestNG)Mockito用于单元测试/模拟。
  9. 请不要使用Struts。说真的,至少使用Struts2,或者最好是JSF2、StripesGWT
  10. 一个不错的错误跟踪器,例如用于集成测试的 JTrac、RedMineFogBugz
  11. Selenium
  12. Sonar 确保代码质量

如果您打算使用不同的 IDE,那么 Maven 可能是一个好主意,因为它允许从 pom 配置每个 IDE .xml(在 IntelliJ/NetBeans 中效果很好)。但我能给你的最好建议就是这个。

  • 选择你已经知道并有经验的东西。您不需要一夜之间从 Struts 过渡到 JSF2。
  • 获得最好的工具,真正免费的东西并不总是正确的选择(尽管通常是这样)。

快乐黑客

I would go for:

  1. Hudson for nightly builds (or for every checkin)
  2. Mercurial or Subversion for source control (works great on both Windows and Mac)
  3. Spring, Spring, Spring. Yes I am serious, Spring solves many more problems than just dependency injection; like security, batch processing, transactions handling, system integration.
  4. EclipseLink for ORM. It's many advanced features (that Hibernate lacks) have often saved me (like decent Stored procedure support).
  5. A light weight container like Jetty, Tomcat or Resin. You are going to commit teamicide if you use heavy slow stuff like Geronimo or JBoss.
  6. DeltaWalker for merge/diff tool (again works on all platforms).
  7. If you are going to use advanced database features then go for OracleXE (and SQLDeveloper). Both are nice tools. If not then something light like H2 or Derby is fine.
  8. JUnit (or TestNG) and Mockito for unit testing/mocking.
  9. Please don't use Struts. Seriously, at least go with Struts2 or preferably something like JSF2, Stripes or GWT.
  10. A decent bugtracker like, JTrac, RedMine or FogBugz
  11. Selenium for integration testing
  12. Sonar for code quality

If you are going to use different IDEs then Maven might be a good idea, since it allows each IDE to be configured from the pom.xml (works great in IntelliJ/NetBeans). But the best advice I can give you is this.

  • Go with what you already know and have experience with. You do not transit from Struts to JSF2 overnight.
  • Get the best tools you can get, seriously free stuff is not always the way to go (although it often is).

Happy hacking

久光 2024-08-22 05:45:29

当你说“技术堆栈”时,真的不清楚你到底在问什么,你是指服务器、库、构建工具吗?不管怎样,这里有一些轻率的建议:

  • Hudson for Continuous Integration
  • 避免使用 Maven,除非你真的非常需要它。它像海妖一样诱惑着您,承诺声明性依赖和约定优于配置,但实践与理论有很大不同:
  • 尽可能使用 Spring,而不是标准 Java SE/Java EE API。除了更简单的 API 之外,它还促进了可测试性和 AOP 功能,这比直接使用 AspectJ 容易得多。当然,它还提供了依赖注入,支持松耦合
  • Hibernate进行ORM,或者如果你的持久性需求很简单,Spring-JDBC可能就足够了

It's really not clear what exactly you're asking about when you say "technology stack", do you mean servers, libraries, build tools? Anyway, here are some flippant recommendations:

  • Hudson for continuous integration
  • Avoid maven unless you really, really need it. It lures you in like a siren with it's promise of declarative dependencies and convention over configuration, but the practice is very different from the theory
  • Use Spring wherever possible in preference to the standard Java SE/Java EE APIs. In addition to the simpler APIs it also facilitates testability and AOP features that are a lot easier than working with AspectJ directly. Of course, it also provides dependency injection which supports loose coupling
  • Hibernate for ORM, or if your persistency requirements are very simple, Spring-JDBC may be enough
小…楫夜泊 2024-08-22 05:45:29

测试环境应该完全复制生产环境。还要在测试环境上进行性能测试。如果硬件是一个问题并且需要限制集群中服务器的数量,那么在测试上创建较少数量的服务器,但复制与产品上相同的环境,即 iplanet (apache ) + weblogic + oracle db 等等....

就本地环境而言,您可以使用Tomcat(因为您只需要Web容器),对于ejb客户端,您可以捆绑jar并进行远程调用(如果您正在对某些远程应用程序进行远程调用)。如果您通过本地 ejb 进行本地调用,那么您将必须在本地盒子上使用 weblogic 进行开发。

尝试使用相同的 IDE(尽管这主要是开发人员选择的问题)。就操作系统而言,这并不重要,因为如果您使用兼容的 IDE,您将仅从中构建代码。

还要确保 IDE 与 tomcat(如果使用的话)或 weblogic 紧密结合,以便在调试模式下运行代码。

一件非常重要的事情,首先决定代码结构,然后在版本控制中签入,以便用户从任何 ide 都以相同的结构签入/签出。因此,所有开发人员共享相同的结构。
在每个版本中对 cvs 或版本控制中的代码进行分支,然后从 head 检出。同样非常重要的是使用单个构建文件并维护安装文档以在本地机器上构建环境。
另外,关于使用的框架,请选择您在编码和维护方面最熟悉的框架。这样您将减少代码中的错误数量。现在大多数人都使用 Spring/Hibernate 组合,但这取决于它是否适合您的项目。
希望这有帮助。

Test environment should exactly replicate production. Also do performance testing on the Test Environment.If hardware is a concern and number of servers in the cluster need to be limited then create less number of servers on Test but do replicate the same env as you have on prod i.e to say iplanet (apache) + weblogic + oracle db so on....

As far as local environment is concerned you can use Tomcat (as you need only the web container), and for the ejb client you can bundle the jar and make remote calls (if you are making remote calls to some remote app).If you are making local calls via local ejbs then you will have to use weblogic in development on local box.

Try to use the same IDE(though its mostly a matter of choice of developers).As far as OS is concerned it doesnot matter since if you are using a compatible IDE you will be building the code from that only.

Also make sure that IDE is tightly couple with either tomcat (if you use that) or weblogic so as to run the code in debug mode.

One very important thing, first decide on a code structure and then checkin that in version control, so that from any ide the user checks in / checks out in the same structure.So that same structure is shared across all developers.
Branch the code in cvs or version control in every release and then checkout from head.Also very important use a single build file and maintain a setup document to build the environment on local box.
Also regarding Framework to use choose the one that you are most comfortable with in coding and maintenance.That way you will reduce the number of bugs in the code.Mostly nowadays people using Spring/Hibernate combination but it depends whether it suits your project.
Hope this helps.

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