titulka-IBA-CZ.jpg Best practices for portlet development PV230 Podnikové portály Petr Adámek, IBA CZ, s.r.o. petr.adamek@ibacz.eu © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Agenda •Best practices for portlet development §Portlet application design §UI design §Coding guidelines §Common mistakes §Common problems and pitfalls with portlets • © 2011 IBA CZ, s.r.o. bg3.jpg •Portlet application design © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Integration into portal •Application should be integrated into portal seamlessly §Focus on key functionality §Provide easy and immediate access to the most useful information and services that users need 95% of the time §Do not reproduce the look and feel of a visually complex application §See UI Design later • © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Integration into portal – IFRAMEs •Use IFRAMEs with caution §The IFRAME fills its content based on a URL which must be addressable by the browser §Not all browser levels support IFRAMEs §If the content is larger than the IFRAME region, then horizontal and vertical scrolling should be enabled © 2011 IBA CZ, s.r.o. Použití frames se zdá jako přirozený způsob tvorby portálů, ale není dobrý nápad je používat. bg3.jpg glob1.jpg Keep portlets simple •Portlets should be as simple as possible §One use-case – one portlet §Beware of different content for different roles §Caching and performance problems §Consider different portlets for different roles §Beware of überportlet §Complicated maintenance §Performance problems §Reduced usebility § • © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Portlet application design •Portlet decomposition rules I. §One use-case – one portlet §Make common functions available externally to portlet §Reusability §Portablity §Use provider beans to represent model in MVC §Use Portlet only as Controller §Do not include application logic or web services calls into portlet § © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Portlet application design •Portlet decomposition rules II. §Do not rely on portlet sessions if the portlet is to allow anonymous access §Problem with old web containers §Timeout problem §Performance problems for large amount of users §Define inter-portlet communication dependencies and interfaces §Defensive programming – good input validation §Well defined contract → well used interface § © 2011 IBA CZ, s.r.o. bg3.jpg •UI Design © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Design §What is design? §A profession and discipline §Simplifies and clarifies §Provide order §Provoke emotional response §Adds value and meaning §Provide information at a glance §Integral part of the development cycle § © 2011 IBA CZ, s.r.o. Clarify = vyjasnit bg3.jpg glob1.jpg Design §What isn’t design? §Design is not applied after the fact §Design is not “putting lipstick” on the product §Design is not art § § © 2011 IBA CZ, s.r.o. Clarify = vyjasnit bg3.jpg glob1.jpg UI Design •Simplicity §Use simple, intuitive user interfaces §Think small §Portlets should be as functional as possible in a minimum of space. §Avoid large logos and disclaimers. §Click through to the back-end application for advanced functionality. §Do not reproduce the look and feel of a visually complex application §HTML over which you have no control §output large amounts of HTML §Portlets should appear in the style of the portal §Portlets should require minimal processing. § • © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg UI Design •Look & Feel §Respect look and feel of portal and its theme §Use standard portlet or portal CSS §Design view to fit on a page with other portlets. §If you need more space §Use maximized portlet mode §Implement two versions of portlet §Set amount of information in portlet preferences §Never impose an exact pixel size on a portlet §Users work in a variety of screen sizes and resolutions §Fixed size can destroy the inherent structure of the portal page • © 2011 IBA CZ, s.r.o. bg3.jpg glob1.jpg Accessibility •Make portlets as accessible as possible §JSPs should be enabled for keyboard control and assistive technologies §Use ALT attribute with images §Use