• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Modularization & componentization for pre Java 9 applications to achieve modularity

 
Ranch Hand
Posts: 1324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If some applications have lots tightly coupled dependencies within a core monolithic module, does migrating to Java 9 help break that module into smaller pieces through the modularization patterns and best practices mentioned in the book?

Does the book cover any dependency breaking technique in order to meet the necessary modifiability requirement?

and finally does the book cover the principles of package cohesion and packing coupling?

Thanks.

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Platform Module System helps to build modules with Strong Encapsulation and with Reliable Configuration. Modules systems like osgi & jboss modules which depends on the classpath has got some encapsulation problems and the configuration of exposing dependency is not reliable as they cannot be checked during compile time for any issues in configuration.

How to build JPMS based modules? and what are the patterns and practices? from one perspective is all about leveraging JPMS for building Application Modules.

On the other hand, we can think in terms of breaking applications into different modules based on functionality or layering by following various design principles. I hope the book covers mostly in terms of the first perspective. I also like to hear what authors has to say
 
Author
Posts: 10
5
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can definitely design for modularity without a module system. Based on build tools like Gradle and Maven for example it was already possible to create module-module projects, and decoupling is possible when programming against interfaces and using services or dependency injection to tie everything together at runtime. There are many good examples of very modular, and well designed, code bases on the classpath.
Untangling an existing code base can be done on the classpath as well, and the techniques to do so are quite universal.

That being said, the module system does make this a lot easier by providing better tools to express modules and their dependencies. In the book you'll find a lot about modular design, and how to fix design problems such as cycles. Although the patterns are mostly universal, we use the feutures of the module system to implement these patterns. Chapters 4-6 are the most relevant for this:
4 - Services
5 - Modularity Patterns
6 - Advanced Modularity Patterns
 
Billy Tsai
Ranch Hand
Posts: 1324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are modularity patterns and best practices different from pre Java 9 apps? or are the very similar or almost the same?
 
Paul Bakker
Author
Posts: 10
5
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The concepts are the same for the most part. Modularity is about design, not about tools, frameworks and language features.
However, it's a lot easier to apply some concepts in practice, such as encapsulation.
 
We noticed he had no friends. So we gave him this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic