MVC框架适用于现有应用程序 [英] MVC Framework for existing application

查看:185
本文介绍了MVC框架适用于现有应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修改很久以前编写的现有java Web应用程序,它以可能的方式编写。它在JSP文件中有业务逻辑和sql statemens。

I am modifying existing java web application that was written long time ago, and it is written in the wrost possible way. It has business logic and sql statemens in JSP files.

由于某些约束,我无法重新设计整个应用程序。但我可以在我添加的任何新功能中实现更好的设计。

Because of the certain constraint, I can not re-design the entire application. but I can implement better design in any new feature that I add.

任何人都可以建议我任何可以轻松集成到现有应用程序中的MVC框架。我需要拥有不依赖于许多外部jar文件的框架,它不会导致现有应用程序出现任何问题。

can anybody suggest me any MVC framework that I could easily integrate in existing app. I need to have framework that is not depended on many external jar files and it does not cause any issues with existing application.

推荐答案


我正在修改现在写的很长时间
之前的java web
应用程序,它用wrost
写成。它在JSP文件中有业务逻辑
和sql statemens。

I am modifying existing java web application that was written long time ago, and it is written in the wrost possible way. It has business logic and sql statemens in JSP files.

听起来像被扔给我的好人选。

Sounds like a good candidate for being thrown away to me.


由于某些约束,我
无法重新设计整个
应用程序。但我可以在
添加的任何新功能中实现
更好的设计。

Because of the certain constraint, I can not re-design the entire application. but I can implement better design in any new feature that I add.

整个应用程序需要重新设计,但你不能重新设计整个应用程序。这是矛盾的。

The entire app needs to be re-designed, but you can't redesign the entire app. It's contradictory.


任何人都可以建议我任何MVC
框架,我可以很容易地将
集成到现有应用程序中。我需要
的框架不依赖于
许多外部jar文件而且
不会导致现有的
应用程序出现任何问题。

can anybody suggest me any MVC framework that I could easily integrate in existing app. I need to have framework that is not depended on many external jar files and it does not cause any issues with existing application.

如果你使用框架,你不能不引起现有应用程序的问题,并且成为外部JAR依赖项。我仍然会推荐它,因为一个框架会给你一个值得额外JAR的升力。你的WAR文件会更大 - 那又怎样?磁盘空间很便宜。

You can't help but cause issues with the existing application, and there will be external JAR dependencies if you use a framework. I'd still recommend it, because a framework will give you a lift that will be worth the extra JARs. Your WAR file will be bigger - so what? Disk space is cheap.

听起来像MVC是你问题最少的。您应该首先专注于正确分层应用程序的想法。如果你有明确定义的持久性和服务层,你可能有机会。

Sounds to me like MVC is the least of your problems. You should be concentrating on the idea of a properly layered application first. If you had well-defined persistence and service tiers you might have a chance.

考虑问题而不用担心现在的用户界面。从持久层开始。获取DAO和模型对象。然后转到服务层:事务,工作单元和使用DAO和模型对象实现的用例。完全对两个层进行单元测试。

Think about the problem without worrying about the UI for now. Start with the persistence tier. Get a DAO and model objects going. Then move onto the service tier: transactions, units of work, and use cases implemented using the DAO and model objects. Unit test both layers thoroughly.

一旦有了这些层,您就可以集中精力使视图层正常工作。让控制器与服务交互会更容易。您的UI可以是HTML,CSS和JavaScript或Flex。所有逻辑都将在视图之外并进入它所属的后端。

Once you have those you're free to concentrate on making the view tier work properly. It'll be easier letting the controllers interact with services. Your UI can be HTML, CSS and JavaScript or Flex. All the logic will be out of the view and into the back end where it belongs.

不要害怕JAR依赖。它可以引导你远离可以帮助你的东西。我首先推荐Spring。它将有助于解决所有分层问题。它的网络MVC也一样好。

Don't be afraid of JAR dependencies. It could steer you away from something that will help you. I'd recommend Spring first and foremost. It'll help with all your layering issues. Its web MVC is as good as there is, too.

这篇关于MVC框架适用于现有应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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