下行ExtJS的" IFRAME建筑QUOT; (我应该重构为MVC模式?) [英] Downside to extjs "iframe architecture" (should I refactor to MVC pattern?)

查看:141
本文介绍了下行ExtJS的" IFRAME建筑QUOT; (我应该重构为MVC模式?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用的iframe架构,即它有一个顶部菜单和索引页上个tabpanel并为iFrame的标签打开了约30项单独的网页内的ExtJS构建的现有的Intranet Web应用程序(仅内部)主要的一个tabpanel。

I have an existing intranet webapp (solely internal) built with ExtJS using an "iframe architecture", i.e. it has a top menu and a tabpanel on an index page and about 30 other separate webpages that open as iframes "tabs" inside the main tabpanel.

有没有使用iframe的任何特别的理由,一切都在同一个域和大多数其他单独的页面都在JavaScript中使用ExtJS的图书馆几乎完全写入。在几乎所有的HTML包括空的HTML,头和身体标签。

There is not any particular reason to use iframes, everything is on the same domain and most of these other seperate pages are written using the ExtJS library almost solely in javascript. The html on almost all of them consists of empty HTML, HEAD and BODY tags.

我真的想重构这个使用ExtJS的MVC架构和沟内部框架,但因为一切正常我不能证明服用的时间来做到这一点。

I would really like to refactor this using the ExtJS MVC architecture and ditch the iframes but because "everything works" I can't justify taking the time to do this.

我想过,但一直没能测试的是:这些单独页面中的每一个有它自己的 Ext.onReady 事件和视口等,这Web应用程序必须加载完整的ExtJS的框架,它打开每一个IFRAME标签,严重放大的客户资源使用情况。任何人都可以证实,这种类型的结构会做,与ExtJS的框架?

One thought I had but haven't been able to test is: with every one of these separate pages having it's own Ext.onReady event and viewport, etc, this webapp must be loading the full ExtJS framework for every iframe-tab it opens, seriously magnifying client resource usage. Can anyone confirm that this type of architecture would do that with the ExtJS framework?

有没有其他可靠的理由,这应该是重构?

Is there any other very solid reasons this should be refactored?

或者,将重构为MVC架构只给我更容易code维护和性能没有提升? (是,目前一切都按预期工作)

Or, would refactoring to MVC architecture only give me easier code maintenance and no performance boosts? (being that currently everything works as intended)

推荐答案

不幸的是,我没有像你所拥有的得心应手的项目,所以我不能测试它自己,但这里是我2C ...:)

Unfortunately I don't have project similar to what you have handy so I can't test it myself but here are my 2c... :)


  1. 我认为每个页面将启动自己的ExtJS的框架副本,但我认为这只是对CPU和内存使用情况的影响。网络流量应该不会很不同,因为核心ExtJS的文件将被缓存。

  1. I do think each page will initiate its own copy of ExtJs framework but I think it only has an affect on CPU and memory usage. Network traffic should not be very different as core ExtJs files will be cached.

我也建议检查出网络流量,同时运行这个程序,你会看到浏览器究竟是如何处理这一切。您可能要增加一些额外的逻辑与核心ExtJS的功能,以确认是否框架实际上实例化多次。

I do recommend to check out network traffic while running this app as you will see how exactly browser handles all this. You might want to add some additional logic into core ExtJs functions to confirm if framework is in fact instantiated several times.

如果最终用户遇到一些性能问题 - 这可能是很好的观点来证明的重构。否则,它是一种很难。当然,除非你在不久的将来扩展功能,并打算继续在这个应用程序的工作的一些计划。

If end users experience some performance issues - it might be very good point to justify re-factoring. Otherwise it's kind of hard. Unless of course you have some plans of expanding functionality in near future and planning on continue working on this application.

这篇关于下行ExtJS的" IFRAME建筑QUOT; (我应该重构为MVC模式?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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