Andrey Glashenko (Haulmont)
How and why to build your own framework in the case of CUBA Platform.
CUBA Platform - A high level open source Java framework for enterprise applications https://www.cuba-platform.com/.
2. @CubaPlatform#CubaPlatform
Konstantin Krivopustov
CTO at Haulmont
• CUBA Platform Team leader
• Coding architect
About authors
Andrey Glaschenko
BDD at Haulmont
• Java developer background,
logistics optimization algorithms
specialist
4. @CubaPlatform#CubaPlatform
High level full stack Java framework for enterprise applications
development
•2008 – development start
•2009 – base of all new Haulmont’s projects
•2012 – first delivered projects by other IT companies
•2014 – released in Russian as a trial
•2015 – released in English
9. @CubaPlatform#CubaPlatform
Vaadin – a perfect match
•Pure server-side Java for application development
•Java (via GWT) for browser side components
•Rich set of components
•Server-side UI code suitable for desktop client
•Vibrant community
•Apache license
10. @CubaPlatform#CubaPlatform
Vaadin – issues
•Resolved: performance in old browsers
•Creating own components is complex
•Resolved: excessive code to create layouts
•Extending components: private fields/methods
•Server-side memory consumption
14. @CubaPlatform#CubaPlatform
OpenJPA FetchPlan
FetchPlan allows OpenJPA to load partial entities (23..29).
Hibernate always loads all attributes (273).
Result: 10 times more data then we need!
• Extra DB server load
• Extra MW CPU load and
memory consumption
17. @CubaPlatform#CubaPlatform
Container
Switched from JBoss EJB to Spring Framework.
CUBA application can be deployed to any lightweight Java web
server.
How we use Spring Framework:
• Dependency injection container for both middleware and clients
• Remoting via HTTP invoker for communication between clients and
middleware
•Low-level tasks schedulers
•RESTful web services
18. @CubaPlatform#CubaPlatform
Build System
Switched from Ant to Gradle.
Encapsulated platform build logic in plugins
More benefits:
• Very fast incremental builds
•Automatic transitive dependency management
•Storing dependencies in a hierarchy of Maven repositories
Gradle DSL complexity isolated by Studio.
20. @CubaPlatform#CubaPlatform
One size does NOT fit all
Off-the-shelf products are great until
customer wants something in his way.
Typical vendor options:
•Say NO. The luckiest get away with it!
•Branch. Easy start of the road to hell..
•Integration points: plugins
21. @CubaPlatform#CubaPlatform
Extension
A project extending the base product, which can modify base product:
•Add new entities, screens,
beans
•Override entity attributes
•Modify screens
•Modify business logic
•Modify style via SCSS
27. @CubaPlatform#CubaPlatform
Typical developer workflow
Studio IDE Type
Project files and build
scripts
Auto
Data model and DB scripts Auto
Standard CRUD screens Auto
MW services and entity
listeners stubs
Auto
Middleware logic Java, JPQL
Complex screens – Studio visual designer, IDE or both XML
Screens logic Java, JPQL
Customize UI Theme SCSS
31. @CubaPlatform#CubaPlatform
CUBA can help
..to deliver your application, if
•it has many screens and some non-trivial business logic
•it has standard UI requirements (no kittens!)
•pre-built business features do not fit
•you want to stay in control
•you have limited time and budget
•it is supposed to be used by multiple customers