Java Developer, Project Lead at MEKOS, Germany • Organization Team JUG Bremen, JCrete, JAlba 06.04.2018 2 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger) By Karte: NordNordWest, Lizenz: Creative Commons by-sa-3.0 de, CC BY-SA 3.0 de, https://commons.wikimedia.org/w/index.php?curid=35392837
how many things a person can think about a once."* • => Chunking • High cohesion • "Incoherent fragments are hard to understands as an undifferentiated soup."* Chunking Example: 06042018 (8 digits, chunking limit 7) *Domain Driven Design, Eric Evans 06.04.2018 10 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger)
how many things a person can think about a once."* • => Chunking • High cohesion • "Incoherent fragments are hard to understands as an undifferentiated soup."* Chunking Example: 06 04 2018 (3 groups, chunking limit 7) *Domain Driven Design, Eric Evans 06.04.2018 11 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger)
Classloader ignores JARs: No Dependency Graph • Linear Scan • More than one version of a class? 06.04.2018 12 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger)
Refactoring (Rabea Gransberger @rgransberger) If we had applied DDD for the example… … it would be easy to split code along: • Bounded Contexts • and maybe Aggregates • DDD Modules not same as Bounded Contexts • think packages / namespaces • Part III tells you more about refactoring to DDD See also: http://dddcommunity.org
need • new customer • new service provider • From monolith to 283 plugins in 5 years • Module boundaries • Refactoring usually easy by using new interfaces 06.04.2018 66 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger)
A lot of work • Hard to test • No benefit in use • Better: Identifiy modules when needed Like in our example to replace pet with card • "The only thing a big bang rewrite guarantees is a Big Bang!" (M. Fowler) 06.04.2018 67 JPoint Moscow / Java 9 Refactoring (Rabea Gransberger @rgransberger)