Effective websites development

665 views

Published on

Anton Vasiliyev - Devexperts team lead has presented his report «Effective website development» on "Magnolia Conference 2012"

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Effective websites development

  1. 1. Effective websites development using Magnolia CMS By Anton Vasiliev avasiliev@devexperts.com
  2. 2. Agenda• Introduction• Increasing the effectiveness of websites development 1. Preview template changes instantly 2. Optimize ModuleVersionHandlers 3. Use OCM libraries for writing business logic code
  3. 3. About Devexperts We create professional financial software for Brokerage and Exchanges since 2002
  4. 4. About Devexperts Headquarters Devexperts Japan www.devexperts.com 197110, 10/1 Barochnaya st. 169-0075東京都新宿区 Saint Petersburg, Russia 高田馬場1-33-15-402 +7 812 438 16 26 +81 3 6233 7460 mail@devexperts.com inquire@devexperts.co.jp
  5. 5. Project architecture Desktop application 3rd party services Magnolia CMS 3 websites Application HTML pages for other apps servers Cloudservices Jackrabbit
  6. 6. Project environment• Weekly releases• 2-3 intermediate builds per week• Aggressive schedule• Up to 5 developers working on the same Magnolia project moduleProject is in closed beta-testing stage
  7. 7. Project environment Integration platform Subversion QA Production platform platform
  8. 8. 1. Preview template changes instantly
  9. 9. Problems• Editing of website templates is slow• Changes made in Magnolia CMS need to be synchronized with module source files• Magnolia CMS restart is required to pick up changes made in module source files
  10. 10. Solution: dx-sync-module• Synchronizes external files with Magnolia CMS resources instantly – JavaScript – CSS – DMS files – JSP and Freemarker templates – Groovy scripts and classes
  11. 11. dx-sync-module approach Project files under version control Version control Magnolia CMS Up and running Changes in source files are instantly propagated to Magnolia CMS
  12. 12. dx-sync-module demo
  13. 13. dx-sync-module: benefits• Instant preview of changes in source files• Reduced number of actions when working with AdminCentral• Decreased number of Magnolia CMS restarts – Using Groovy may decrease number of restarts further• Developed for large project, helps with small projects
  14. 14. 2. OptimizeModuleVersionHandlers
  15. 15. Problems• 2 execution flows: one for install and one for update• Easy to forget to update module version handler when a file or XML resource is changed• Version handlers become very large for intensively developing module
  16. 16. A new approach toModuleVersionHandlersIdea: forget about deltasDescribe module configuration as it should beConfiguration is ‘synchronized’, not ‘updated’
  17. 17. DxModuleVersionHandler• Describe updating strategy for each resource• Strategies supported: – Keep up to date – Install once – Remove• A part of dx-sync-module
  18. 18. DxModuleVersionHandlermodule files• Describe how files are updated in ModuleVersionHandler class
  19. 19. DxModuleVersionHandlerXML resources • Put XML resources to the correct place
  20. 20. DxModuleVersionHandlerTakes care of:• Exported XML files• Resources (CSS, JavaScript)• Templates (Freemarker, JSP)• Groovy (classes and scripts)• Module servlets• Module filesJust put a file to the right place and it will beupdated next time Magnolia CMS starts
  21. 21. DxModuleVersionHandler: benefits• The same configuration mechanism is used for both install and update• Less code• Significantly reduced number of bugsIncreases developers efficiency
  22. 22. dx-sync-module - links• Documentation http://code.devexperts.com/display/DXMGNL/dx-sync-module• JIRA http://jira.magnolia-cms.com/browse/DXSYNC• Maven http://nexus.magnolia- cms.com/content/repositories/magnolia.forge.releases/• Questions, suggestions and feedback avasiliev@devexperts.com
  23. 23. 3. Use OCM libraries for writing business logic code
  24. 24. Use OCM for business logic codeBefore OCM
  25. 25. Use OCM for business logic codeAfter OCM
  26. 26. Object Content Mapping libraries• Magnolia CMS Content2Bean mechanism – Read only• Jackrabbit OCM – http://jackrabbit.apache.org/object-content-mapping.html• Magnolia Jackrabbit OCM Integration – http://www.fastforward.ch/web/ff/dokumentation/entwickler/ magnolia-module-ocm.html• Devexperts Jackrabbit OCM integration for Magnolia – http://code.devexperts.com/display/DXMGNL/dx-magnolia-ocm
  27. 27. dx-magnolia-ocm• Doesn’t depend on Magnolia – May be used to read Magnolia Jackrabbit database from other applications• Type safe• Library, not a module• Configuration via annotations – Keep all information at the same place
  28. 28. dx-magnolia-ocm - links• Documentation http://code.devexperts.com/display/DXMGNL/dx-magnolia-ocm• JIRA and Maven coming very soon• Questions, suggestions and feedback avasiliev@devexperts.com
  29. 29. Questions?
  30. 30. Thank you. By Anton Vasiliev avasiliev@devexperts.com

×