什么是现有的Web应用程序凌乱迁移到优雅MVC的最佳方式? [英] What is the best way to migrate an existing messy webapp to elegant MVC?

查看:88
本文介绍了什么是现有的Web应用程序凌乱迁移到优雅MVC的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入了一个新的公司大约一个月前。该公司是相当小的规模和有pretty强启动的感觉。我的工作作为一个团队3人的Java开发人员。该公司主要生产销售服务,为企业/商业型的人在互相交流使用。

I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating with each other.

一个主要的事情,我已经和将工作,是公司的主要网站 - 从服务销售,现有用户登录,检查他们的服务,并支付他们的账单,新用户可以注册进行试用,等。目前这是一个JSP应用程序部署在Tomcat上,能够访问由THRU公司本身写的持久层做了数据库。

One of the main things I have been, and will be working on, is the main website for the company - from which the service is sold, existing users login to check their service and pay their bills, new users can sign up for a trial, etc. Currently this is a JSP application deployed on Tomcat, with access to a database done thru a persistence layer written by the company itself.

我有一个在这里重复和不断增长的挫折(我pretty高兴与整体的工作,所以这不是一个哦,不,我不喜欢我的工作型后)是没有任何更大的设计或架构此Web应用程序的。该应用程序是由数十个JSP页面,几乎没有逻辑的Servlet或豆类或任何其他种类的框架存在。许多JSP页面的上千种code线,它们的jsp:包括其他JSP页面,业务逻辑与HTML混合,$经常使用的片段C $ C(例如获得网络服务连接)剪切和粘贴,而不是再利用等。换句话说,该应用程序是一个混乱。

A repeated and growing frustration I am having here (and I'm pretty happy with the job overall, so this isn't an "oh no I don't like my job"-type post) is the lack of any larger design or architecture for this web application. The app is made up of several dozen JSP pages, with almost no logic existing in Servlets or Beans or any other sort of framework. Many of the JSP pages are thousands of lines of code, they jsp:include other JSP pages, business logic is mixed in with the HTML, frequently used snippets of code (such as obtaining a web service connection) is cut and paste rather than reused, etc. In other words, the application is a mess.

有一直是公司的努力,使其更好的MVC到重新设计本网站内的一些传言;我认为开发商和上级都开始意识到,这目前意大利面条code的模式是不可持续的,或很容易升级增加更多功能,为用户。上级领导和开发商持谨慎态度完全重新写的东西(有很好的理由,因为这将意味着数周或工作月重写现有的功能),但我们已经有中(慢)一些讨论的重写网站的某些地区进入一个新的框架。

There have been some rumblings within the company of trying to re-architect this site so that it fits MVC better; I think that the developers and higher-ups are beginning to realize that this current pattern of spaghetti code isn't sustainable or very easily scalable to add more features for the users. The higher-ups and developers are wary of completely re-writing the thing (with good reason, since this would mean several weeks or months of work re-writing existing functionality), but we've had some discussions of (slowly) re-writing certain areas of the site into a new framework.

有哪些最好的策略,以使移动应用和codeBase的这个方向?我怎么能作为一个开发者真正帮助待着这一点,并很快,也似乎没有像混蛋-Y新来的家伙谁进入工作,并告诉大家他们已经写什么都是扯淡?在那里,你已经在你自己的工作经验,使用,当你遇到这样的事情?任何行之有效的战略和经验。

What are some of the best strategies to enable moving the application and codebase into this direction? How can I as a developer really help move this along, and quickly, without seeming like the jerk-y new guy who comes into a job and tells everyone that what they've written is crap? Are there any proven strategies or experiences that you've used in your own job experience when you've encountered this sort of thing?

推荐答案

您最好的选择可能是重构它慢慢地你走。我们中很少有将需要完全的东西,有埋在这么多的业务规则从头开始的资源。管理真的恨它,当你花几个月的时间开发具有比您更换一个更多的错误的应用程序。

Your best bet is probably to refactor it slowly as you go along. Few us of have the resources that would be required to completely start from scratch with something that has so many business rules buried in it. Management really hates it when you spend months on developing an app that has more bugs than the one you replaced.

如果你不得不从头开始构建任何单独的应用程序的机会,使用所有的最佳实践那里,用它来证明他们是多么有效。当你能,逐步将这些想法变成旧的应用程序。

If you have the opportunity to build any separate apps from scratch, use all of the best practices there and use it to demonstrate how effective they are. When you can, incorporate those ideas gradually into the old application.

这篇关于什么是现有的Web应用程序凌乱迁移到优雅MVC的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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