Adaptive Object Model
7
http://adaptiveobjectmodel.com
• Class Definition model in
instance level
• Definition can be stored in a
XML file or database.
• Very Flexible to Extend
• Polymorphism for multi-
tenant
Drawbacks:
• Hard to read code
• Error-prone
Reflection + AOM
8
• Since Java 1.2
• Java Class definition can be
accessible with Reflection
APIs
• For the concrete part, Get
the Metadata from Class
Definition
• For the flexible part, use the
AOM
Annotation + Reflection + AOM
9
• Since Java 1.5
• Rather use separated XML
files, use @ for specifying
additional (user-defined)
metadata for class definition
Supporting Multi-tenancy
NoSQL databases
1. Inherent multi-tenancy - Schema Free
2. High Performance - Horizontally scalable and Memory cache
3. Web optimized – Query results are JSON - data can be
parsed by web browser directly and performantly.
Additionally -
4. Easy to implement Analytic services (MR) and Full Text Search
5. Event-driven Transaction - don't have to care about CQRS
something
6. Some NoSQL products (Couchbase, Cassandra) provides
pessimistic locking and ANSI SQL (Join Query) - easily
migrate to them.
DevOps: Issues
Continuous Delivery
11
Company Deploy Frequency Deploy Lead Time Reliability Customer
Responsiveness
Amazon 23,000 / day Minutes High High
Google 5,500 / day Minutes High High
Netflix 500 / day Minutes High High
Facebook 1 / day Hours High High
Twitter 3 / week Hours High High
Typical enterprise Once every 9 months Months or quarters Low / Medium Low / Medium
출처: 도서 The Phoenix Project
Amazon, Google, Netflix, Facebook, Twitter는 얼마나 자주 배포할까요?
Micro Service Architecture
Contract based, Polyglot Programming
Separation of Concerns, Parallel Development, Easy Outsourcing
Written in Java
Written in Node
Written in PHP
Level 0: Swamp of POX
• Use as a RPC, returns full serialized document
16
<openSlotList>
<slot start = "1400" end = "1450">
<doctor id = "mjones"/>
</slot>
<slot start = "1600" end = "1650">
<doctor id = "mjones"/> </slot> </openSlotList>
Level 1: Resources
Level 1 tackles the question of handling complexity by using divide
and conquer, breaking a large service endpoint down into multiple
resources.
17
<openSlotList>
<slot id = "1234" doctor = "mjones" start = "1400" end = "
<slot id = "5678" doctor = "mjones" start = "1600" end = "
</openSlotList>
Level 2: HTTP Verbs
Level 2 introduces a standard set of verbs so that we handle similar
situations in the same way, removing unnecessary variation.
18
Operation HTTP / REST
Create PUT / POST
Read (Retrieve) GET
Update (Modify) PUT / PATCH
Delete (Destroy) DELETE
Level 3: Hypermedia Controls
19
<appointment>
<slot id = "1234" doctor = "mjones" start = "1400" end =
"1450"/> <patient id = "jsmith"/>
<link rel = "/linkrels/appointment/cancel" uri =
"/slots/1234/appointment"/>
<link rel = "/linkrels/appointment/addTest" uri =
"/slots/1234/appointment/tests"/>
<link rel = "self" uri = "/slots/1234/appointment"/>
<link rel = "/linkrels/appointment/changeTime" uri =
"/doctors/mjones/slots?date=20100104@status=open"/>
<link rel = "/linkrels/appointment/updateContactInfo" uri =
"/patients/jsmith/contactInfo"/>
<link rel = "/linkrels/help" uri = "/help/appointment"/>
</appointment>
Level 3 introduces discoverability, providing a way of making a
protocol more self-documenting.
Micro Service Architecture
• 변경된 서비스만 재배포
Side effect 최소화
• 자율성
각 서비스에 대한 자유로운 언어, 아키텍처, 아웃소싱 용이
• 병렬 개발, 타임 투 마켓, 린 개발
Front-end
Image
Server
(Python)
Business
Logic
Server
(Java)
Extended Role of Front-end in Cloud Applications
Aggregator for multiple (polyglot programmed) micro-services
Component
Service
(C)
AJAX, RESTful
Concurrent Cloud Applications are composed of multiple
Micro Services and front-end serves as an aggregator of the
services
Writing One Page Web App
Problems: One Page Web App Low Cohesion and High Coupling
<style>
style for A
style for B
style for C
</style>
<html>
element for A
element for B
element for C
</html>
<script>
script for A
script for B
script for C
</script>
W3C Web Components
<style>
style for A
style for B
style for C
</style>
<html>
element for A
element for B
element for C
</html>
<script>
script for A
script for B
script for C
</script>
#A.html
<style>
style for A
</style>
<html>
element for A
</html>
<script>
script for A
</script>
#B.html
<style>
style for B
</style>
<html>
element for B
</html>
<script>
script for B
</script>
#C.html
<style>
style for C
</style>
<html>
element for C
</html>
<script>
script for C
</script>
#index.html
<A> <A>
<B> <B> <B>
<C>
Web Components : Implementations
• Provides Cohesive Component Model
• Component Composition by HTML
markup
• Dynamic Data Binding
• Responsive Web by Material Design
• Standard
Polymer VueJS
MW4 개발 프로세스
생
성
생
성
• Full-fledged Responsive Web
Single Page Application
• With google-material design• POJO based Domain Model
• Add annotations (JAX-RS, JPA,
Jackson, metaworks)
• Domain Class Analysis
도메인
클래스
모델링
애노테이
션
UI 컴포넌
트 배치
DDD(Domain-Driven Design) - 도메인 주도 설계
• 마이크로서비스를 구현하기에 앞서 설계하기 위해 필요한 유용한 개념 DDD.
• 추천 도서 : “Eric Evans의 Domain Driven Design”, 도메인 주도 설계
• DDD에서 얻을 수 있는 해법(책에서 다루는 내용)
• 어떤 단위로 서비스를 구성할 것인가
• 서비스의 결합
• 변화에 강한 설계
• 레거시 시스템을 단계적 폐기
• 리팩터링 전략
35
BRIDGING THE WORLDS OF DDD & REST, https://ordina-
jworks.github.io/conference/2016/07/10/SpringIO16-DDD-Rest.html
https://www.infoq.com/minibooks/domain-driven-design-quickly
Generate ERD and Entity Classes (ORM)
• Open the Class Diagram in the
Project Explorer > Diagram
Navigator > ClassDiagram
• Set the type of attributes
– String for most types
– boolean for gender
– int for options
– double for money
– java.util.Date for Dates, timestamp
• Modeling > ORM > Generate Code
• Database Code Generation Options:
– Framework: JPA
– Persistence API: POJO
• Be careful:
– All attributes must have its type
– All classes should be belong to any
package
39
Generated Entity Classes (JPA)
• All Entity Codes are POJO Classes that are described with Java Annotations meaning
entity field descriptions and relationships.
40
The Length of Code
52
323Lines
For Developing Full-CRUD, RESTful, MSA-based,
Material-Designed, Responsive, Grid+Form, Multi-
tenant and Self-Served Application:
• Number of fields of the entity: 10
• Total lines of code per an entity:
92 for front-end,
215 for domain class,
16 lines for repository.
How it works
Common Metadata
Domain Model
Classes
Class model for tenant1
ORM for tenant1
Common class model
Metadata of
Tenant1
Metadata of
Tenant2
Metadata of
Tenant3
Class model for tenant2
ORM for tenant2
Class model for tenant3
ORM for tenant3
Override by tenantID
Multi-tenant / Self service Support
Self service
Self service
portal
• Add new attribute
• Attributes can be String,
number, Data from referenced
class (table)
• Change the title, order of
attributes
• Hide/Show attribute
OCE Billing – Open Source Billing
https://github.com/TheOpenCloudEngine/uEngine-bill
Roadmap
• Self Service Portal Tags – ssp-process, ssp-rule
• Annotation based HATEOAS Support
• CQRS Transaction
Roadmap
• Self Service Portal Tags – ssp-process, ssp-rule
• Annotation based HATEOAS Support
• CQRS Transaction
Spring REST/JPA/MySQL Couchbase Bucket API
API GW
consistency
Tip: SOA and MSA
65
SOA MSA
Aggregation
(데이터 통합)
Backend 가 주도 Front 가 주도
Database 통합 데이터베이스 서비스 별 데이터베이스
필수 환경 WAS DevOps, PaaS (Grid
Engine)
서비스 굵기 업무 비즈니스 기능별 구현 팀별, 10000 라인
이하로?, 관심사별
Container / Packaging WAS / WAR Spring-Boot, Docker
References
• Metaworks4 – www.metaworks4.io
• SPOSAD Architecture Style -
https://pdfs.semanticscholar.org/7635/17ef805f24e64c8bc1b9e221e1
cdbc7ef416.pdf
• Rest in Practice, pdf online - https://www.gitbook.com/book/dennis-
xlc/rest-in-practice/details
• DDD quickly, pdf online –
https://www.infoq.com/minibooks/domain-driven-design-quickly
• Spring JPA –
https://spring.io/guides/gs/accessing-data-jpa/
• Spring JPA and HATEOAS –
https://spring.io/guides/gs/accessing-data-rest/
• Mapping JPA entities to external REST resources in spring-data-rest –
https://objectpartners.com/2016/02/18/mapping-jpa-entities-to-
external-rest-resources-in-spring-data-rest/
• Vue JS with Material Design - https://vuematerial.github.io/#/getting-
started
67
Hinweis der Redaktion
레가시와의 통합 – Self Service
Visual Mashup 에 대한 화면
MSA - DevOps 자동화 퍼포먼스의 최대한의 발휘를 위한 아키텍처
테스트 자동화를 위한 ALPS 의 확대
서비스간의 발견 – Ribbon,
By Consulting or By Framework
Concourse?
이득을 보는 경우, 실패하는 경우
레가시와의 통합 – Self Service
Visual Mashup 에 대한 화면
MSA - DevOps 자동화 퍼포먼스의 최대한의 발휘를 위한 아키텍처
테스트 자동화를 위한 ALPS 의 확대
서비스간의 발견 – Ribbon,
By Consulting or By Framework
Concourse?
이득을 보는 경우, 실패하는 경우