the dark arts of building your own framework (andrey glashenko)
TRANSCRIPT
@CubaPlatform#CubaPlatform
The Dark arts of building your own framework
Andrey GlaschenkoKonstantin Krivopustov@CubaPlatform www.cuba-platform.com
@CubaPlatform#CubaPlatform
Konstantin KrivopustovCTO at Haulmont• CUBA Platform Team leader• Coding architect
About authors
Andrey GlaschenkoBDD at Haulmont• Java developer background,
logistics optimization algorithms specialist
@CubaPlatform#CubaPlatform
About Haulmont• Based in Samara (Russia) and
London• Specializing in Java enterprise
software• Products in ECM and taxi fleet
management areas• Bespoke solutions
@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
@CubaPlatform#CubaPlatform
Yet another framework?• Existing frameworks: either low level or too “heavy”
Requirements• Full stack• Web UI• Feature rich• Uniform• Open
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
UI
@CubaPlatform#CubaPlatform
Requirements•Web•Fast to develop hundreds of screens with standard UI•Same language for the whole application
•Ability to assign a whole feature to a developer
•Code transparency and easier refactoring
@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
@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
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
ORM
@CubaPlatform#CubaPlatform
@CubaPlatform#CubaPlatform
AttributesAllJob - 88Account – 29Individual – 24Service – 32Payment_type – 16Driver - 61Vehicle – 23Total: 273
RequiredJob - 17Account – 1Individual – 1Service – 1Payment_type – 1Driver - 1Vehicle – 1Total: 23
@CubaPlatform#CubaPlatform
OpenJPA FetchPlanFetchPlan 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
@CubaPlatform#CubaPlatform
OpenJPA issues•Abandoned by IBM -> development almost stopped•JPA 2.1 not supported (join on, stored procs, etc)
Solution: migrate to EclipseLink (Q3 2015)
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
Other
tech
nolog
ie
s
@CubaPlatform#CubaPlatform
ContainerSwitched 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
@CubaPlatform#CubaPlatform
Build SystemSwitched 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.
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
Exte
nsion
s
@CubaPlatform#CubaPlatform
One size does NOT fit allOff-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
@CubaPlatform#CubaPlatform
ExtensionA 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
@CubaPlatform#CubaPlatform
All CUBA projects are extensions
@CubaPlatform#CubaPlatform
Adding an attribute
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
Develo
ping
CUBA
appli
catio
ns
@CubaPlatform#CubaPlatform
Tools and Languages
Tools•IDE•+ IDE Plugin•+ Studio
Languages•Java•XML•JPQL
@CubaPlatform#CubaPlatform
Shortcutting the development cycle
See result
Make change
Compile
DeployRestart
Hot deploy
@CubaPlatform#CubaPlatform
Typical developer workflowStudio IDE TypeProject files and build scripts
Auto
Data model and DB scripts
Auto
Standard CRUD screens AutoMW services and entity listeners stubs
Auto
Middleware logic Java, JPQLComplex screens – Studio visual designer, IDE or
bothXML
Screens logic Java, JPQLCustomize UI Theme SCSS
@CubaPlatform#CubaPlatform
Next step: PaaS
Studio
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
Summar
y
@CubaPlatform#CubaPlatform
Our place in the ecosystem
@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
@CubaPlatform#CubaPlatform
Interested?Welcome to our stand S5!
•Live development process demo•Examples of CUBA applications
<Stand photo>
@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform
Q & A