DEV Community

Alexsandro Souza
Alexsandro Souza

Posted on • Updated on

Enforcing modularity principles with Java

I am always posting provoking post on my Linkedin, and I have decided to replicate those here. Let's socialize!

Effectively draw microservice boundaries is a hard job. Let's be honest, how often do you get your boundaries right the first time or even the second?

Redrawing microservice boundaries involves a lot of interpersonal communication to not let things blow up at run-time.

Refactoring across modules is easier, and it is supported by the type system and the compiler.

In Java, for example, Since Java 9 native module system is part of the language. Java modules can express dependencies on other modules and publicly export interfaces while strongly encapsulating implementation classes. Other languages offer similar mechanisms. For instance, JavaScript got a module system as of ES2015.

I have created a project where I designed and implemented a monolithic application that was built using modularity principles. Check it out!

Discussion (0)