SlideShare a Scribd company logo
1 of 53
Download to read offline
The ideal module system ...
… and the harsh reality

Adam Warski
SoftwareMill

#DV13 #modules
Wednesday 13 November 13

@adamwarski
New languages
Are we focusing on the wrong problem?

#DV13 #modules
Wednesday 13 November 13

@adamwarski
About me

• During the day: coding @ SoftwareMill
• SoftwareMill: a great software house!
• Afternoon: playgrounds, Duplo, etc.
• Evening: blogging, open-source
•
•
•

Original author of Hibernate Envers
ElasticMQ, Veripacks, MacWire
http://www.warski.org

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Plan for the next 50 minutes

• Ideal module system
• Veripacks
• Ceylon

#DV13 #modules
Wednesday 13 November 13

@adamwarski
What is a module?
• OSGi bundle?
• Jigsaw-something?
• Maven build module?
• Guice module?
• Ruby module?
#DV13 #modules
Wednesday 13 November 13

@adamwarski
What is a module?

Source: http://www.merriam-webster.com/dictionary/module

#DV13 #modules
Wednesday 13 November 13

@adamwarski
The Modularity Continuum

#DV13 #modules
Wednesday 13 November 13

@adamwarski
The Modularity Continuum
Classes

Single responsibility principle
#DV13 #modules
Wednesday 13 November 13

@adamwarski
The Modularity Continuum
Classes

#DV13 #modules
Wednesday 13 November 13

Packages

@adamwarski
The Modularity Continuum
Classes

Packages

Build modules

#DV13 #modules
Wednesday 13 November 13

@adamwarski
The Modularity Continuum
Classes

Packages

Build modules

#DV13 #modules
Wednesday 13 November 13

Projects

@adamwarski
The Modularity Continuum
Classes

Packages

Build modules

Projects

Systems
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Ideal module
system
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Group code

• Comprehensible chunks of
•
•
•

code
Specific (single)
responsibility
Isolation
Namespacing

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Reusable

• Across one system
• Across multiple systems
• Industry standards

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Abstraction

• Hide implementation
•
•

details
Decide what is accessible
to who
Not only what, but also
how (wiring)

Wassily Kandinsky, Accent on Rose, 1926

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Interfaces

• Multiple implementations
• A way to define the

interface & data structures

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Composability

• Create big modules from
•
•

smaller ones
Hierarchical
Scalable

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Replaceable

• Swap implementations
• Run time/load time/build
time

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Meta

• Dependencies
• Versioning
• Specify & verify

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Requirements

• Group code
• Reusable
• Abstraction
• Interfaces
• Composability
• Replaceable
• Meta
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Requirements

• So ... what now?
• Let’s create a new

revolutionary language™!

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Packages &
Veripacks
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Packages
Classes

Packages

Build modules

Projects

Systems
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Packages

• Namespacing
• Simple string identifiers
• Parent-child relations?

• com.company.myapp.finance
• com.company.myapp.finance.invoicing

#DV13 #modules
Wednesday 13 November 13

@adamwarski
All classes are equal?

• “By default” classes are public
• Which class is the main one?
• What’s the responsibility of the package?

#DV13 #modules
Wednesday 13 November 13

@adamwarski
One public class per package

• Make only one class public
• Other: package-protected
• Clearly visible:
•
•

what is the responsibility of the package
what’s the main entry point

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Growing the concept

• Support from JVM/Java ends here
• What if the functionality is big?
•
•

extract a sub-package
now the classes in the sub-package must be public

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Enter Veripacks

• Specify which classes are exported from a package
•
•

hierarchy
Respect package parent-child relationships
Allow exporting classes & child packages

• Using annotations
• Verify Package Specifications
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Enter Veripacks
package	
  foo.bar.p1	
  {
	
  	
  @Export
	
  	
  class	
  A	
  {	
  ...	
  }

package	
  foo.bar.p2	
  {
	
  	
  class	
  Test	
  {
	
  	
  	
  	
  //	
  ok
	
  	
  	
  	
  new	
  A()

	
  	
  class	
  B	
  {	
  ...	
  }
}

	
  	
  	
  	
  //	
  illegal
	
  	
  	
  	
  new	
  B()

package	
  foo.bar.p1.sub_p1	
  {
	
  	
  class	
  C	
  {	
  ...	
  }
}

	
  	
  	
  	
  //	
  illegal
	
  	
  	
  	
  new	
  C()
	
  	
  }
}

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Veripacks: exporting

• By default: export all
• Export a class
• Export a child package
• ... or any mix
• Transitive!
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Running Veripacks

public	
  void	
  testPackageSpecifications()	
  {
	
  	
  	
  VeripacksBuilder
	
  	
  	
  	
  .build()
.verify(“foo.bar”)	
  //	
  root	
  package	
  to	
  check
.throwIfNotOk()
}

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Veripacks: importing

• Also transitive
•

to sub-packages

• Specify that a package needs to be imported
•
•

@Import
@RequiresImport

• Importing 3rd party libraries
#DV13 #modules
Wednesday 13 November 13

@adamwarski
3rd party library import example
//	
  src/main/scala/org/veripacks/reader/package-­‐info.java
@Import("org.objectweb")
package	
  org.veripacks.reader;
import	
  org.veripacks.Import;
VeripacksBuilder
	
  	
  	
  .requireImportOf("org.objectweb")
	
  	
  	
  .build
	
  	
  	
  .verify("org.veripacks")
	
  	
  	
  .throwIfNotOk()

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Replacing build modules?

• Why do we create build modules?
•
•
•
•
•

isolate parts of code
api/impl split
adding a 3rd party lib to a part of code
group code with similar functionality
statically check inter-module dependencies

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Build modules are heavy

• Maven: elaborate xml
• Separate directory structure
• Hard to extract a common part
• Additional thing to name
#DV13 #modules
Wednesday 13 November 13

@adamwarski
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Other benefits

• No need to think when functionality is “big enough” to create
•
•

a module
Test code sharing
Refactoring, easy to:

•
•
•

introduce a module
remove a module
rename a module

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Packages+Veripacks as modules?

• Group code
• Partially reusable
• Abstraction: yes (@Export)
• Interfaces: no
• Composability: partial (transitivity)
• Replaceable: no
• Meta: dependencies yes (@Import), versioning no
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Ceylon

#DV13 #modules
Wednesday 13 November 13

@adamwarski
What is Ceylon?

• “A language for writing large programs in teams”
• Cross-platform (Java/JS)
• Statically typed (union, intersection types, ...)
• OO/FP mix
• Typesafe metaprogramming
• 1.0 with an IDE available: http://ceylon-lang.org/
• ... and modularity
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Ceylon modules
Classes

• Moving a level higher
• A bit similar to OSGi,
•

Build modules

Projects

Jigsaw
But part of the language

#DV13 #modules
Wednesday 13 November 13

Packages

Systems
@adamwarski
Sharing

• In Ceylon things can be shared, or not
• Things:
•
•

program elements (classes, class members)
packages

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Modularity concepts in Ceylon
•

•

3 basic concepts:
modules
packages
classes

•
•
•

Classes mostly similar as in Java
(from the modularity perspective)

•

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Packages in Ceylon

• Separate file with
•

meta-data
Annotations

•
•

sharing
comments

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Modules in Ceylon

• Bundles a set of packages into a .car archive
• Package names: prefix of the module name
• Import other modules

#DV13 #modules
Wednesday 13 November 13

@adamwarski
There’s more!

• Runnable modules
• Local/remote repositories
used:

#DV13 #modules
Wednesday 13 November 13

‣ during the build
‣ when running

@adamwarski
There’s more!

• Run-time component
•
•

isolated class-loaders
based on JBoss Modules

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Modules in Ceylon

• Group code
• Reusable: yes
• Abstraction: yes (shared)
• Interfaces: no
• Composability: partial
• Replaceable: partial
• Meta: yes (both for packages and modules)
• Run-time
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Summing up

• Modules come in different flavors & sizes
• How many explicit module types do we want?
•
•
•

scalability
small, but specialized?
from very big to very small, general?

• Which requirements should which types meet?
• Challenge for the Next Big Language?
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Links

• http://github.com/adamw/veripacks
• http://ceylon-lang.org
• http://warski.org

#DV13 #modules
Wednesday 13 November 13

@adamwarski
Thank you; Come & get a sticker

http://codebrag.com/devoxx/
#DV13 #modules
Wednesday 13 November 13

@adamwarski
Party!

#DV13 #modules
Wednesday 13 November 13

@adamwarski

More Related Content

What's hot

Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Brian LeRoux
 
Presentational jQuery
Presentational jQueryPresentational jQuery
Presentational jQueryDoug Neiner
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013dmethvin
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQueryGill Cleeren
 
component: ruby gems for the browser
component: ruby gems for the browsercomponent: ruby gems for the browser
component: ruby gems for the browserTimothy Oxley
 
Re-Introduction to Third-party Scripting
Re-Introduction to Third-party ScriptingRe-Introduction to Third-party Scripting
Re-Introduction to Third-party Scriptingbenvinegar
 
Sizzle jQCon San Francisco 2012
Sizzle jQCon San Francisco 2012Sizzle jQCon San Francisco 2012
Sizzle jQCon San Francisco 2012livelogos
 
Best Practices - Mobile Developer Summit
Best Practices - Mobile Developer SummitBest Practices - Mobile Developer Summit
Best Practices - Mobile Developer Summitwolframkriesing
 
Ruby :: Training 1
Ruby :: Training 1Ruby :: Training 1
Ruby :: Training 1Pavel Tyk
 

What's hot (12)

遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Palm Developer Day PhoneGap
Palm Developer Day PhoneGap
 
Presentational jQuery
Presentational jQueryPresentational jQuery
Presentational jQuery
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
component: ruby gems for the browser
component: ruby gems for the browsercomponent: ruby gems for the browser
component: ruby gems for the browser
 
Rails traps
Rails trapsRails traps
Rails traps
 
Re-Introduction to Third-party Scripting
Re-Introduction to Third-party ScriptingRe-Introduction to Third-party Scripting
Re-Introduction to Third-party Scripting
 
Sizzle jQCon San Francisco 2012
Sizzle jQCon San Francisco 2012Sizzle jQCon San Francisco 2012
Sizzle jQCon San Francisco 2012
 
Best Practices - Mobile Developer Summit
Best Practices - Mobile Developer SummitBest Practices - Mobile Developer Summit
Best Practices - Mobile Developer Summit
 
Ruby :: Training 1
Ruby :: Training 1Ruby :: Training 1
Ruby :: Training 1
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Similar to The ideal module system and the harsh reality

ACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpiseACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpisePeter Pilgrim
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
OpenCSW - What is the project about?
OpenCSW - What is the project about?OpenCSW - What is the project about?
OpenCSW - What is the project about?dmichelsen
 
walkmod: quick start
walkmod: quick startwalkmod: quick start
walkmod: quick startwalkmod
 
Responsive Design and jQuery Mobile
Responsive Design and jQuery MobileResponsive Design and jQuery Mobile
Responsive Design and jQuery MobileTroy Miles
 
OpenStack Swift production deployments
OpenStack Swift production deploymentsOpenStack Swift production deployments
OpenStack Swift production deploymentsAtul Jha
 
Lessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet AgentsLessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet AgentsPuppet
 
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...Daniel Fisher
 
Contributing to the Community
Contributing to the CommunityContributing to the Community
Contributing to the CommunityWO Community
 
Securing Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and KubernetesSecuring Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and KubernetesUptycs
 
MongoTalk/Voyage
MongoTalk/VoyageMongoTalk/Voyage
MongoTalk/VoyageESUG
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshopMathieu Elie
 
Engineering culture
Engineering cultureEngineering culture
Engineering culturePamela Fox
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Olaf Alders
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overviewrajdeep
 
Third party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipThird party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipSascha Brinkmann
 

Similar to The ideal module system and the harsh reality (20)

ACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpiseACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the Enterpise
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet Design
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
OpenCSW - What is the project about?
OpenCSW - What is the project about?OpenCSW - What is the project about?
OpenCSW - What is the project about?
 
walkmod: quick start
walkmod: quick startwalkmod: quick start
walkmod: quick start
 
Responsive Design and jQuery Mobile
Responsive Design and jQuery MobileResponsive Design and jQuery Mobile
Responsive Design and jQuery Mobile
 
OpenStack Swift production deployments
OpenStack Swift production deploymentsOpenStack Swift production deployments
OpenStack Swift production deployments
 
Lessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet AgentsLessons I Learned While Scaling to 5000 Puppet Agents
Lessons I Learned While Scaling to 5000 Puppet Agents
 
MDN is easy!
MDN is easy!MDN is easy!
MDN is easy!
 
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
 
Contributing to the Community
Contributing to the CommunityContributing to the Community
Contributing to the Community
 
Gophers, whales and.. clouds? Oh my!
Gophers, whales and.. clouds? Oh my!Gophers, whales and.. clouds? Oh my!
Gophers, whales and.. clouds? Oh my!
 
Securing Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and KubernetesSecuring Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and Kubernetes
 
MongoTalk/Voyage
MongoTalk/VoyageMongoTalk/Voyage
MongoTalk/Voyage
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
 
Engineering culture
Engineering cultureEngineering culture
Engineering culture
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
 
Third party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationshipThird party libraries and OSGi - a complicated relationship
Third party libraries and OSGi - a complicated relationship
 

More from Adam Warski

What have the annotations done to us?
What have the annotations done to us?What have the annotations done to us?
What have the annotations done to us?Adam Warski
 
Hejdyk maleńka część mazur
Hejdyk maleńka część mazurHejdyk maleńka część mazur
Hejdyk maleńka część mazurAdam Warski
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcingAdam Warski
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesAdam Warski
 
ElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverAdam Warski
 
Recommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionRecommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionAdam Warski
 
CDI Portable Extensions
CDI Portable ExtensionsCDI Portable Extensions
CDI Portable ExtensionsAdam Warski
 

More from Adam Warski (8)

What have the annotations done to us?
What have the annotations done to us?What have the annotations done to us?
What have the annotations done to us?
 
Hejdyk maleńka część mazur
Hejdyk maleńka część mazurHejdyk maleńka część mazur
Hejdyk maleńka część mazur
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcing
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queues
 
ElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS server
 
Recommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionRecommendation systems with Mahout: introduction
Recommendation systems with Mahout: introduction
 
Scala Macros
Scala MacrosScala Macros
Scala Macros
 
CDI Portable Extensions
CDI Portable ExtensionsCDI Portable Extensions
CDI Portable Extensions
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

The ideal module system and the harsh reality

  • 1. The ideal module system ... … and the harsh reality Adam Warski SoftwareMill #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 2. New languages Are we focusing on the wrong problem? #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 3. About me • During the day: coding @ SoftwareMill • SoftwareMill: a great software house! • Afternoon: playgrounds, Duplo, etc. • Evening: blogging, open-source • • • Original author of Hibernate Envers ElasticMQ, Veripacks, MacWire http://www.warski.org #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 4. Plan for the next 50 minutes • Ideal module system • Veripacks • Ceylon #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 5. What is a module? • OSGi bundle? • Jigsaw-something? • Maven build module? • Guice module? • Ruby module? #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 6. What is a module? Source: http://www.merriam-webster.com/dictionary/module #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 7. The Modularity Continuum #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 8. The Modularity Continuum Classes Single responsibility principle #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 9. The Modularity Continuum Classes #DV13 #modules Wednesday 13 November 13 Packages @adamwarski
  • 10. The Modularity Continuum Classes Packages Build modules #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 11. The Modularity Continuum Classes Packages Build modules #DV13 #modules Wednesday 13 November 13 Projects @adamwarski
  • 12. The Modularity Continuum Classes Packages Build modules Projects Systems #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 13. Ideal module system #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 14. Group code • Comprehensible chunks of • • • code Specific (single) responsibility Isolation Namespacing #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 15. Reusable • Across one system • Across multiple systems • Industry standards #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 16. Abstraction • Hide implementation • • details Decide what is accessible to who Not only what, but also how (wiring) Wassily Kandinsky, Accent on Rose, 1926 #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 17. Interfaces • Multiple implementations • A way to define the interface & data structures #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 18. Composability • Create big modules from • • smaller ones Hierarchical Scalable #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 19. Replaceable • Swap implementations • Run time/load time/build time #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 20. Meta • Dependencies • Versioning • Specify & verify #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 21. Requirements • Group code • Reusable • Abstraction • Interfaces • Composability • Replaceable • Meta #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 22. Requirements • So ... what now? • Let’s create a new revolutionary language™! #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 23. Packages & Veripacks #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 25. Packages • Namespacing • Simple string identifiers • Parent-child relations? • com.company.myapp.finance • com.company.myapp.finance.invoicing #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 26. All classes are equal? • “By default” classes are public • Which class is the main one? • What’s the responsibility of the package? #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 27. One public class per package • Make only one class public • Other: package-protected • Clearly visible: • • what is the responsibility of the package what’s the main entry point #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 28. Growing the concept • Support from JVM/Java ends here • What if the functionality is big? • • extract a sub-package now the classes in the sub-package must be public #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 29. Enter Veripacks • Specify which classes are exported from a package • • hierarchy Respect package parent-child relationships Allow exporting classes & child packages • Using annotations • Verify Package Specifications #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 30. Enter Veripacks package  foo.bar.p1  {    @Export    class  A  {  ...  } package  foo.bar.p2  {    class  Test  {        //  ok        new  A()    class  B  {  ...  } }        //  illegal        new  B() package  foo.bar.p1.sub_p1  {    class  C  {  ...  } }        //  illegal        new  C()    } } #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 31. Veripacks: exporting • By default: export all • Export a class • Export a child package • ... or any mix • Transitive! #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 32. Running Veripacks public  void  testPackageSpecifications()  {      VeripacksBuilder        .build() .verify(“foo.bar”)  //  root  package  to  check .throwIfNotOk() } #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 33. Veripacks: importing • Also transitive • to sub-packages • Specify that a package needs to be imported • • @Import @RequiresImport • Importing 3rd party libraries #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 34. 3rd party library import example //  src/main/scala/org/veripacks/reader/package-­‐info.java @Import("org.objectweb") package  org.veripacks.reader; import  org.veripacks.Import; VeripacksBuilder      .requireImportOf("org.objectweb")      .build      .verify("org.veripacks")      .throwIfNotOk() #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 35. Replacing build modules? • Why do we create build modules? • • • • • isolate parts of code api/impl split adding a 3rd party lib to a part of code group code with similar functionality statically check inter-module dependencies #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 36. Build modules are heavy • Maven: elaborate xml • Separate directory structure • Hard to extract a common part • Additional thing to name #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 37. #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 38. Other benefits • No need to think when functionality is “big enough” to create • • a module Test code sharing Refactoring, easy to: • • • introduce a module remove a module rename a module #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 39. Packages+Veripacks as modules? • Group code • Partially reusable • Abstraction: yes (@Export) • Interfaces: no • Composability: partial (transitivity) • Replaceable: no • Meta: dependencies yes (@Import), versioning no #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 40. Ceylon #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 41. What is Ceylon? • “A language for writing large programs in teams” • Cross-platform (Java/JS) • Statically typed (union, intersection types, ...) • OO/FP mix • Typesafe metaprogramming • 1.0 with an IDE available: http://ceylon-lang.org/ • ... and modularity #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 42. Ceylon modules Classes • Moving a level higher • A bit similar to OSGi, • Build modules Projects Jigsaw But part of the language #DV13 #modules Wednesday 13 November 13 Packages Systems @adamwarski
  • 43. Sharing • In Ceylon things can be shared, or not • Things: • • program elements (classes, class members) packages #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 44. Modularity concepts in Ceylon • • 3 basic concepts: modules packages classes • • • Classes mostly similar as in Java (from the modularity perspective) • #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 45. Packages in Ceylon • Separate file with • meta-data Annotations • • sharing comments #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 46. Modules in Ceylon • Bundles a set of packages into a .car archive • Package names: prefix of the module name • Import other modules #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 47. There’s more! • Runnable modules • Local/remote repositories used: #DV13 #modules Wednesday 13 November 13 ‣ during the build ‣ when running @adamwarski
  • 48. There’s more! • Run-time component • • isolated class-loaders based on JBoss Modules #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 49. Modules in Ceylon • Group code • Reusable: yes • Abstraction: yes (shared) • Interfaces: no • Composability: partial • Replaceable: partial • Meta: yes (both for packages and modules) • Run-time #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 50. Summing up • Modules come in different flavors & sizes • How many explicit module types do we want? • • • scalability small, but specialized? from very big to very small, general? • Which requirements should which types meet? • Challenge for the Next Big Language? #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 51. Links • http://github.com/adamw/veripacks • http://ceylon-lang.org • http://warski.org #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 52. Thank you; Come & get a sticker http://codebrag.com/devoxx/ #DV13 #modules Wednesday 13 November 13 @adamwarski
  • 53. Party! #DV13 #modules Wednesday 13 November 13 @adamwarski