what's my modularity

Download What's My Modularity

If you can't read please download the document

Upload: bob-paulin

Post on 18-Aug-2015

48 views

Category:

Software


0 download

TRANSCRIPT

  1. 1. What's my Modularity
  2. 2. The bearing of a child takes nine months, no matter how many women are assigned - Fred Brooks
  3. 3. But could we make 9 babies in 9 Months.
  4. 4. What is Modularity?
  5. 5. UNIX Rule of Modularity Developers should build a program out of simple parts connected by well defined interfaces, so problems are local, and parts of the program can be replaced in future versions to support new features. This rule aims to save time on debugging code that is complex, long, and unreadable. - Eric Raymond
  6. 6. What makes a module?
  7. 7. Java Application Architecture Kirk Knoernschild Testable Deployable Manageable Natively Reusable Composable Stateless
  8. 8. Identifiable
  9. 9. Portable
  10. 10. Containable
  11. 11. Designing Modules
  12. 12. The modularizations include the design decisions which must be made before the work on independent modules can begin. - David Parnas
  13. 13. Changeability
  14. 14. Independent Development
  15. 15. Comprehensibility
  16. 16. Java Out of the Box
  17. 17. Identifiable Portable
  18. 18. Containable Package Private Private Interface
  19. 19. What's Missing in Java?
  20. 20. Versioning 1.0.0
  21. 21. Protection for Internal Classes
  22. 22. How Do We Deal?
  23. 23. Dependency Injection Dependency Management
  24. 24. A good start but. We need to start thinking in deployable units
  25. 25. Project Jigsaw JEP 200: The Modular JDK JEP 201: Modular Source Code JEP 220: Modular Run-Time Images JSR 376: Java Platform Module System
  26. 26. Key Features of Jigsaw
  27. 27. No more JRE vs JDK Distinction
  28. 28. Package Level Encapsulation java.security.sasljava.basejava.loggingjavax.security.saslcom.sun.security.sasl.utiljava.security.jgss
  29. 29. Versioned Upgradable Modules
  30. 30. Dynamic Configuration
  31. 31. OSGi
  32. 32. How OSGi provides modularity
  33. 33. MANIFEST.MF Bundle-SymbolicName: detection-module Bundle-Version: 1.0.0 Bundle-Name: detection-module Bundle-ManifestVersion: 2 Export-Package: com.bobpaulin.modularity.detect;version="1.0.0";uses:= "com.bobpaulin.modularity.api",com.bobpaulin.modularity.detect.intern al;version="1.0.0";uses:="com.bobpaulin.modularity.api,com.bobpaulin. modularity.detect,groovy.lang" Import-Package: com.bobpaulin.modularity.api;version="[1.0,2)",groovy. lang;version="[2.3,3)",org.apache.tika;version="[1.0,2)",org.codehaus .groovy.reflection;version="[2.3,3)",org.codehaus.groovy.runtime;vers ion="[2.3,3)",org.codehaus.groovy.runtime.callsite;version="[2.3,3)", org.codehaus.groovy.runtime.typehandling;version="[2.3,3)"
  34. 34. Identifiable Bundle-Name + Bundle-Version Bundle-SymbolicName: detection-module Bundle-Version: 1.0.0
  35. 35. Portable Bundle File (jar) Service Registry
  36. 36. Containable Package Based Whitelist Export-Package: com.bobpaulin.modularity.detect;version="1.0.0";uses:= "com.bobpaulin.modularity.api",
  37. 37. Tradeoffs Complexity Performance Flexibility
  38. 38. Converting the Ball Of Mud to OSGi
  39. 39. Containers
  40. 40. Virtualization
  41. 41. Docker
  42. 42. Identifiable Container Name + Version
  43. 43. Portable Docker Image
  44. 44. Containable Process, Resource, File and Network Isolation (cgroups, UnionFS, namespaces)
  45. 45. Tradeoffs Complexity Performance Flexibility
  46. 46. Demo Converting single JVM OSGi to Containers
  47. 47. Why does this look easy?
  48. 48. No cyclical dependencies
  49. 49. Implementations separate from Interfaces
  50. 50. Interfaces are simple
  51. 51. I cheated. (design was prepared over several days)
  52. 52. ReferencesParnas, D. L. On the criteria to be used in decomposing systems into modules. Commun. ACM 15, 12 (December 1972), 1053-1058. DOI=10.1145/361598.361623 http://doi.acm.org/10.1145/361598.361623 Knoernschild, Kirk. Java Application Architecture: Modularity Patterns with Examples Using OSGi Addison-Wesley Professional 2012 Brooks, Fred. The Mythical Man-Month: Essays on Software Engineering Addison-Wesley 1975 Raymond, Eric S. The Art of Unix Programming Addison-Wesley 2003 Perlis, Alan. Epigrams in Programming ACM SIGPLAN Notices 17 (September 1982) http://www.cs.yale.edu/homes/perlis-alan/quotes.html
  53. 53. Links Sonar http://www.sonarqube.org/ Sonar Source Dashboard http://nemo.sonarqube.org/dashboard/index Docker https://www.docker.com/ Apache Felix http://felix.apache.org/ Amdatu Remote http://www.amdatu.org/components/remote.html Gradle https://gradle.org/ Gradle Templates https://github.com/townsfolk/gradle-templates Apache Tika https://tika.apache.org/ Tesseract OCR https://github.com/tesseract-ocr/tesseract Project Jigsaw http://openjdk.java.net/projects/jigsaw/
  54. 54. Bob Paulin Email [email protected] Or [email protected] Twitter @bobpaulin GitHub https://github.com/bobpaulin CJUG Meetup http://www.meetup.com/ChicagoJUG/ Twitter @cjug Devoxx4Kids Chicagoland Website http://devoxx4kids.org/usa/chicago/ http://www.meetup.com/Devoxx4Kids- Chicagoland-Area/ Twitter @devoxx4kids_chi Off Heap Java Pubhouse Website http://www.javaoffheap.com/ http://www.javapubhouse.com/ Twitter @offheap