Apache Zest COP Composite Oriented Programming October 2 nd , 2015 - - PowerPoint PPT Presentation

apache zest
SMART_READER_LITE
LIVE PREVIEW

Apache Zest COP Composite Oriented Programming October 2 nd , 2015 - - PowerPoint PPT Presentation

ApacheCon EU 2015 Apache Zest COP Composite Oriented Programming October 2 nd , 2015 Jiri Jetmar, CEO Smartnerds GmbH Paul Merlin, Title/Role here Agenda What is Apache Zest ? Zest Libraries & App Building Strategies


slide-1
SLIDE 1

October 2nd, 2015 Jiri Jetmar, CEO Smartnerds GmbH Paul Merlin, Title/Role here

ApacheCon EU 2015

Apache Zest

COP – Composite Oriented Programming

slide-2
SLIDE 2

§ What is Apache Zest ?

Agenda

“Genius is one percent inspiration and ninety–nine percent perspiration.”

Thomas A. Edison

§ Zest Libraries & App Building Strategies § Zest Community, Real World Apps & Outlook § Sample App – Live Coding Session

slide-3
SLIDE 3

Apache Zesttm Fact Sheet :: History

§ Apache Zest was born as Qi4j in 2007 § Founded by Richard Öberg (EJBoss, later JBoss) and Niclas Hedhman § Version 1.0, 1.1 and 1.2 in 2010 § Version 2.0 in 2013 § Since beginning of 2015 a “Gold” Apache Foundation Project // JJ § Current Version 2.1, 3.0 in 2015 with lots of new features

2007 2009 2010 2012 2013 2015 later 2015

Born of Qi4j Version 3.0 2nd Gen Version 2.0 Apache Zest

slide-4
SLIDE 4

:: (Re-) Usage of proven patterns

Apache Zest Core

Apache Zesttm – It is about solving (business) problems

§ Zest is nothing new. It is an logical next step based on existing and proved patterns and ideas § Zest is an Java implementation of the Composite Oriented Programming (COP) pattern § COP is a programming model that allows the creation of rich domain models

:: Business problem centric approach

1) Start with the business problem 2) Use the terminology from Domain Driven Design (DDD) 3) Allow developers to implement the Domain Model directly in code using that Terminology 4) Plug infrastructural building blocks that reflects the needs and requirements COP DI AOP DDD …

Proven and well-known patterns COP fragments are used to composite Applications

slide-5
SLIDE 5

Apache Zesttm – What sort of problems to solve with Zest ? :: Rich Domain Models

§ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diamZest is an § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam

:: High ratio of DM changes over time :: Transactional, integrative and API centric Applications

§ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diamZest is an § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diamZest is an § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam § Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam

slide-6
SLIDE 6

:: COP in one sentence Apache Zesttm & COP Overview

“Composite Oriented Programming allows developers to work with 'fragments', smaller than classes, and 'compose' fragments into larger 'composites' which acts like the regular objects.”

:: COP & Apache Zest

§ The most basic element in Zest is the Composite § A Composite is created by composing a number of Fragments § Mixings are Fragments that can handle method invocations § Modifiers are Fragments that modify method invocations (Decorator pattern) – Constraints, Concern, SideEffects

Niclas Hedhman

slide-7
SLIDE 7

:: Fragments Apache Zesttm Basic Fragments

Constraint Concern SideEffect Mixin(1)

Property(1) Property(n) Association

Mixin(n) Composite(1) § @Constraint validates method arguments

§ Can have many Constraints per argument § Uses annotations to trigger § Cooperate with concern for failure actions

§ @Concerns intercept method calls

§ Allowed to modify arguments and i.) return values, ii.) return with calling in chain, iii.) throws exceptions

§ @SideEffects are called after a method call has finished

§ Cannot change method arguments or return value § Cannot throws exceptions § Can inspect exceptions and return values § May be asynchronous

§ @Mixins implements Composite interfaces

§ A Mixin may implement one interface, many interfaces or just some methods § May contain Composite state, such as Property and Association instances § May be Composite private – not exposed in Composite interface

Figure XX : Composite Fragments

slide-8
SLIDE 8

:: Application Structure Apache Zesttm Structure Composition

§ Composites define the internals of objects

§ Explicit Composite meta types : Value, Entity, Service and Transient

§ Composites resides in Modules § Modules can be grouped into Layers

§ One or more Layers per Application § Zero, one or more Modules per Layer

§ Visibility and dependency of Composites between structures is controlled

§ Declaration of Visibility of Composites

Dependency and Visibility

Module

Composite(1) Composite(n) Layer

Figure XX : Structure Composition Figure XX : Application Structering

Metatypes : Value, Entity, Service and Transient

slide-9
SLIDE 9

§ What is Apache Zest ?

Agenda

§ Apache Zest Libraries & App Building Strategies

“Genius is one percent inspiration and ninety–nine percent perspiration.”

Thomas A. Edison

§ Zest Community, Real World Apps & Outlook § Sample App – Live Coding Session

slide-10
SLIDE 10

Apache Zesttm Library ecosystem ( .. there is much more !)

Apache Zest Core

Entity Store Entity Index

ElasticSearch File / Memory RDF LevelDB Neo4j RIAK SQL Solr

Metrics Scheduling Event Sourcing Caching Data Migration Scala integration

I/O Streaming API

Functional API Configuration

Geospatial Query

HATEOAS REST API Re-Indexing

slide-11
SLIDE 11

Application Building – A bit „grey“ Theory

Figure XX : Top-Down Application Model

S(1) F(1) S(n) F(n) Interaction ¡ Model Channels Service ¡ Model Functional ¡ Model State ¡ ¡ Model

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore Todo..

slide-12
SLIDE 12

Figure XX : Concrete Zest-based Application structure

Application Building – ... How to do using Zest !

REST API I Module REST API II Module Domain Model A InMemory Store Module ElasticSearchIndex Module WebJetty Module .. Module

Service ¡ Layer Domain ¡ Layer

  • Infra. ¡

Layer Config Layer Clients

slide-13
SLIDE 13

§ What is Apache Zest ?

Agenda

“Genius is one percent inspiration and ninety–nine percent perspiration.”

Thomas A. Edison

§ Sample App – Live Coding Session § Zest Libraries & App Building Strategies § Zest Community, Real World Apps & Outlook

slide-14
SLIDE 14

Sample App – Live Coding Session

$ git clone https://github.com/xxx/xxxx.git

slide-15
SLIDE 15

§ What is Apache Zest ?

Agenda

§ Key Components, Building Blocks & Ecosystem

“Genius is one percent inspiration and ninety–nine percent perspiration.”

Thomas A. Edison

§ Zest Community, Real World Apps & Outlook § Sample App – Live Coding Session

slide-16
SLIDE 16

:: Community Apache Zesttm Community

The current Zest developer community is rather small, but passionate individuals who are all convinced of Zest's merit and potential.

… so do not wait, JOIN us right now !!

Over the years there has been 28 code contributors in total, of which 8 have been considered Core Developers, i.e. allowed to make changes on the Core runtime on trunk without hand-holding. No access control was in place to enforce that, and a social contract worked very well. We are looking forward to..

slide-17
SLIDE 17

Who is using Apache Zesttm ?

http://smarpay.ch is a swiss company that offers mobile payment services in the vending business. Apache Zest is used to offer backoffice services like settlement and clearing for about 3k vending machines and about 350k mobile users.

Productive

P* - http://dieparkuhr.de is a german Startup that offers services around the car parking business. Apache Zest is used for the entire backoffice with a large number of services like User-/Partner Management, Product Catalog, Reservation- & Scheduling System, Payment Services.

In development

slide-18
SLIDE 18

:: Current Version is 2.1 Apache Zesttm Outlook

§ First release of the Qi4j codebase under the ASF umbrella. Still uses org.qi4j.* for backward compability. § A number of feature added ( Complex Configuration Types, NamedAssiciations, toValue() and toEntity() conversions) § Bugfixings and cleanups § ..

:: Outlook for 3.0 (end of 2015)

§ Full Java 8 Support (Lambda, Streaming API, ..) § GeoSpatial Queries § ...

slide-19
SLIDE 19

Thank you !

See you at https://zest.apache.org ! J J