Building modular applications




Kamal Govindraj
TenXperts Technologies
About Me
   Programming for 13 Years
   Architect @ TenXperts Technologies
   Trainer / Consultant @ SpringPeople
    T...
Agenda
   Importance of Moudlarity
   How to?
   Challenges
   Tools & best practices
   OSGI
Modularity
   Break application into smaller modules
   Interaction between module via interfaces
   Helps in dealing w...
Horizontal / Technology
                                  Presentation
   Catalog    Inventory
             Inventory    O...
Vertical / Functional
                  Order
                                        Presentation
                       ...
Vertical is better
   Scales better
    −   Team size
    −   Feature
   Separate concerns along the lines of business
 ...
Physical Vs Logical
   Logical separation provides most of the
    benefits
   Phyiscal separation issues
    −   Perfor...
Package guidelines
               Visible to other
                  modules

                      Visible to other
     ...
Challenges
   Builds become more complex
   Changes across module boundaries are
    harder
   Integration issue
   Wi...
Tools & Frameworks
   Maven
    −   Simplifies multi module builds
    −   Declarative dependency
    −   Transitive depe...
Maven in action
Dependency Injection
   Takes care of wiring together components
    from different modules
   The modules are loosely c...
Java module limitation
   Jar is the basic construct for defining modules
   Only a compile time construct
    −   Modul...
Runtime modularity
   OSGI
    −   A mature specification & platform
    −   Eclipse is built on OSGI
    −   So are many...
OSGI
   A module is a jar with metadata (MANIFEST
    file)
    −   exported packages
    −   Imported packages with vers...
OSGI != modular
   OSGI can make a existing modular
    application work better
   Breaking up a system into well define...
Questions ?
Thank You.
Upcoming SlideShare
Loading in …5
×

Building modular applications

1,004 views
953 views

Published on

For a moderately complex application to manage complexity it needs to be broken up into smaller modules – which can be developed / tested independently. The modularization should be based on the domain rather than along layers (dao/service etc). This session will focus on some guidelines on how to breakup large applications into modules and how to realize that modularity in an application that uses Spring, Hibernate, Maven. The talk is based on the experience gained implementing (and refining) these techniques in 3-4 large product development that I have been involved in.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,004
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Building modular applications

  1. 1. Building modular applications Kamal Govindraj TenXperts Technologies
  2. 2. About Me  Programming for 13 Years  Architect @ TenXperts Technologies  Trainer / Consultant @ SpringPeople Technologies  Enteprise applications leveraging open source frameworks (spring,hibernate, gwt,jbpm..)  Key contributor to InfraRED & Grails jBPM plugin (open source)
  3. 3. Agenda  Importance of Moudlarity  How to?  Challenges  Tools & best practices  OSGI
  4. 4. Modularity  Break application into smaller modules  Interaction between module via interfaces  Helps in dealing with complexity  Break development into smaller teams  Reuse  Easier to maintain
  5. 5. Horizontal / Technology Presentation Catalog Inventory Inventory Order Service / Domain Persistence
  6. 6. Vertical / Functional Order Presentation Inventory Catalog Order Application Inventory Catalog
  7. 7. Vertical is better  Scales better − Team size − Feature  Separate concerns along the lines of business functionality  Easier to maintain
  8. 8. Physical Vs Logical  Logical separation provides most of the benefits  Phyiscal separation issues − Performance overheads − Reduces reliability − Increased Complexity
  9. 9. Package guidelines Visible to other modules Visible to other modules Private classes / Not visible outside this module
  10. 10. Challenges  Builds become more complex  Changes across module boundaries are harder  Integration issue  Wiring the system together
  11. 11. Tools & Frameworks  Maven − Simplifies multi module builds − Declarative dependency − Transitive dependency handling − Versioned
  12. 12. Maven in action
  13. 13. Dependency Injection  Takes care of wiring together components from different modules  The modules are loosely coupled depending only on the published interfaces  Spring Framework / Google Guice / EJB 3.0 ..
  14. 14. Java module limitation  Jar is the basic construct for defining modules  Only a compile time construct − Modules are not preserved at run time  No way to enforce strict separation  Difficult to have multiple versions of same module in a vm  Not easy to share modules across multiple applications
  15. 15. Runtime modularity  OSGI − A mature specification & platform − Eclipse is built on OSGI − So are many of the application servers − Multiple implementations (Equinox, Felxi, Knopflerfish  JSR 294 – Simple module system for Java
  16. 16. OSGI  A module is a jar with metadata (MANIFEST file) − exported packages − Imported packages with versions − Other module dependecies with versions  OSGI container − Manages module lifecycle − Resolve dependencies − Enforces strict separation
  17. 17. OSGI != modular  OSGI can make a existing modular application work better  Breaking up a system into well defined modules and maintaining it that way is the harder part  Tools can help – but ...
  18. 18. Questions ?
  19. 19. Thank You.

×