Downside to extjs “iframe architecture” (should I refactor to MVC pattern?)

不羁岁月 提交于 2019-12-11 07:15:39

问题


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.

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.

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.

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?

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


回答1:


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. 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.

  2. 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.

  3. 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.



来源:https://stackoverflow.com/questions/10237023/downside-to-extjs-iframe-architecture-should-i-refactor-to-mvc-pattern

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!