the dark arts of building your own framework (andrey glashenko)

33
@CubaPlatform #CubaPlatform The Dark arts of building your own framework Andrey Glaschenko Konstantin Krivopustov @CubaPlatform www.cuba-platform.com

Upload: -

Post on 16-Apr-2017

185 views

Category:

Software


0 download

TRANSCRIPT

Page 1: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

The Dark arts of building your own framework

Andrey GlaschenkoKonstantin Krivopustov@CubaPlatform www.cuba-platform.com

Page 2: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 3: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 4: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 5: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Yet another framework?• Existing frameworks: either low level or too “heavy”

Requirements• Full stack• Web UI• Feature rich• Uniform• Open

Page 6: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

UI

Page 7: The Dark arts of building your own framework (Andrey Glashenko)
Page 8: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 9: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 10: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 11: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

ORM

Page 12: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Page 13: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

AttributesAllJob - 88Account – 29Individual – 24Service – 32Payment_type – 16Driver - 61Vehicle – 23Total: 273

RequiredJob - 17Account – 1Individual – 1Service – 1Payment_type – 1Driver - 1Vehicle – 1Total: 23

Page 14: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 15: The Dark arts of building your own framework (Andrey Glashenko)

@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)

Page 16: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

Other

tech

nolog

ie

s

Page 17: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 18: The Dark arts of building your own framework (Andrey Glashenko)

@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.

Page 19: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

Exte

nsion

s

Page 20: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 21: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 22: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

All CUBA projects are extensions

Page 23: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Adding an attribute

Page 24: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

Develo

ping

CUBA

appli

catio

ns

Page 25: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Tools and Languages

Tools•IDE•+ IDE Plugin•+ Studio

Languages•Java•XML•JPQL

Page 26: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Shortcutting the development cycle

See result

Make change

Compile

DeployRestart

Hot deploy

Page 27: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 28: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Next step: PaaS

Studio

Page 29: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

Summar

y

Page 30: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Our place in the ecosystem

Page 31: The Dark arts of building your own framework (Andrey Glashenko)

@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

Page 32: The Dark arts of building your own framework (Andrey Glashenko)

@CubaPlatform#CubaPlatform

Interested?Welcome to our stand S5!

•Live development process demo•Examples of CUBA applications

<Stand photo>

Page 33: The Dark arts of building your own framework (Andrey Glashenko)

@YourTwitterHandle#DVXFR14{session hashtag} @CubaPlatform#CubaPlatform

Q & A