Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2012-12-13T12:55:08Z by CarlD
CarlD
CarlD
46 Posts
ACCEPTED ANSWER

Pinned topic Performance issues with model containers

‏2012-12-11T20:13:14Z |
I've been doing some research on how wise it is to use model containers extensively, and I came across the following advice from the wiki (http://www-10.lotus.com/ldd/pfwiki.nsf/xpDocViewer.xsp?lookupName=WebSphere+Portlet+Factory+7.0.1+Documentation#action=openDocument&res_title=About_using_models_within_containers_wpf701&content=pdcontent)


Performance is related to the number of linked models in the container. More linked models in your model container lead to slower performance, but also leads to more manageable code, because it is in smaller chunks.


Does this mean that swapping contained models in/out frequently is bad, or does it refer to the depth of the linking (contained model itself has model containers)?

Thanks. Carl.


IBM Certified Solution Developer - WebSphere Portlet Factory 7.0
My blog http://dsixe-wpf.blogspot.com
Updated on 2012-12-13T12:55:08Z at 2012-12-13T12:55:08Z by CarlD
  • mburati
    mburati
    2552 Posts
    ACCEPTED ANSWER

    Re: Performance issues with model containers

    ‏2012-12-12T23:34:48Z  in response to CarlD
    Carl,
    Unfortunately, it's probably one of those "it depends" kind of answers, which depends on how many model containers, how many each user uses etc.

    Another WEF Best Practice on the WEF Wiki suggests not swapping models in and out of containers but rather having a container for each contained model and showing/hiding them as necessary (to keep things simple and avoid complexity and/or potential issues where one of your modules gets confused as to which contained model is currently swapped in etc)...

    If you've got a few model containers, I'm guessing you wouldn't notice the difference in performance much if you had a couple more or a couple less. If you have some contained models that some set of users hardly ever use, then it could be more efficient for those users (less memory used, etc) having them in separate contained models as opposed to that functionality in your main model.

    Building portlets for portal, you should also consider when your portlet is getting too complex (don't build a portal inside a portlet) and when you should separate out functionality into multiple communicating portlets rather than continuing to add so much complexity to a single portlet that it becomes a maintainability issue (whether built with WEF or any other tool).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    • CarlD
      CarlD
      46 Posts
      ACCEPTED ANSWER

      Re: Performance issues with model containers

      ‏2012-12-13T12:55:08Z  in response to mburati
      Mike - the problem you mentioned is exactly what my current client is facing. Their projects contain a multitude of models, all of which are imported into each other into an unmaintainable jumble.

      A while ago I had designed a pattern consisting of a controller model (using model container) with event handlers that swapped in the necessary model at runtime. Instead of navigating directly to a page, a contained model fires an event requesting the controller to swap in a target model which renders the page. This keeps everything nice and tidy, and decoupled.

      I'm not sure about performance characteristics of this pattern now. The applications the client is building typically consist of many pages, breaking them out into portlets is not really feasible. Maybe I need to look at linked models.

      Thanks for the feedback.
      Carl.

      (I documented my pattern here http://www-10.lotus.com/ldd/pfwiki.nsf/dx/Leveraging_the_Model_Container_Builder)


      IBM Certified Solution Developer - WebSphere Portlet Factory 7.0
      My blog http://dsixe-wpf.blogspot.com