SlideShare a Scribd company logo
Service Architecture Patterns
Avinash Chugh
Vivek Singh
Rohith Rajagopal
Designs are neither good nor bad.
They are more or less useful.
Martin Fowler
Service = SOA service
External Interface
Interface contracts
Maps service contracts to/from domain entities
Interacts with DDD services
Cross functional responsibility
SOA
Services
Services
Mappers
Service
Contract
Persistence
Mappings
Repositories
get client
requests as
request/response with
domain objects
Factories Entities
Value
Objects
Aggregates
Domain
Model
find domain objects
orchestrates
business logic
read/write
data source
send request contract to
find/save domain objects
Service = DDD Service
Core business logic
Orchestrates domain layer
Reusable within a SOA service
Simple Banking Application
Customer(1)----(*)Account(1)----(*)Transaction
Opening an account
View transactions across accounts
Account Summary
Customer Profile
Perform transaction
Service Responsibility Partition
Breaking system into different services
Minimal Distributed System
Architecture
Services
Database
User
Interface
Application
Grows to monolithic services
Single database
Everything gets deployed every time
Test everything every time
Need for smaller sub-systems
Database
Domain
Model
Service A
Database
Domain
Model
Service B
Database
Domain
Model
Service C
Database
Domain
Model
Service D
Data Ownership Driven Services
Advantages
Development decoupling
Independent evolution
Deployment independence
Low testing cost
Disadvantages
Inner loop problem/N+1 problem
Database
Domain
Model
Account
Service
Database
Domain
Model
Transaction
Service
Customer
Acc 1
Acc2
Acc4
Acc3
Txn1
Txn2
Txn3
Txn1
Txn5
Txn1
Txn2
Txn1
AccountService calling TxnService
GetTransactions(acc1)
GetTransactions(acc2)
GetTransactions(acc3)
GetTransactions(acc4)
Batch Request Interface
GetTransactions(acc1, acc2, acc3, acc4)
Use correlation ids instead of order
Doesn’t solve all problems
Transaction Atomicity
Database
Domain
Model
Service A
Database
Domain
Model
Service C
Customer
New
Acc
Txn1
Transaction
No transaction between service operations
Distributed transaction has performance issues
Database
Domain
Model
Service A
Domain
Model
Service C
Domain
Model
Service B
Domain
Model
Service D
Shared Data Services
Database Database
Advantages
Easier resolution of performance issues
Transaction support
Development still quite independent
Disadvantages
Unclear domain boundaries
Fuzzy ownership of data
Code duplication across services
Tradeoffs
Code duplication
Model duplication
Transactions
Service Independence
Performance
Data Ownership
vs
Service Contract Design
By design & not by side-effect
Service is a product
Contract is user interface for service
Can help in multi-version capability
Banking application contract
class OpenAccountRequest
{
int CustomerId;
DateTime StartingDate;
AccountType AccountType;
Name AccountHolderName;
}
class Name
{
string FirstName;
string LastName;
}
enum AccountType
{
Savings,
Current
}
class OpenAccountRequest
{
string CustomerId;
string StartingDate;
string AccountType;
Name AccountHolderName;
}
class Name
{
string FirstName;
string LastName;
}
class OpenAccountRequest
{
int CustomerId;
DateTime StartingDate;
AccountType AccountType;
Name AccountHolderName;
}
class Name
{
string FirstName;
string LastName;
}
enum AccountType
{
Savings,
Current
}
Possible starting dates
03/11/2010
03/11/10
03-11-2010
03-11-10
03-Nov-2010
3-Nov-10
Possible customer id
008675100004664
100004664
8675100004664
CC008675100004664
Service
Serve as much as possible
class OpenAccountRequest
{
string CustomerId;
string StartingDate;
string AccountType;
string AccountHolderFirstName;
string AccountHolderLastName;
}
class OpenAccountRequest
{
string CustomerId;
string StartingDate;
string AccountType;
Name AccountHolderName;
}
class Name
{
string FirstName;
string LastName;
}
Business doesn’t understand objects
….and definitely not class inheritance
class OpenJointAccountRequest : OpenAccountRequest
{
int AccountNumber;
}
class OpenAccountRequest
{
string CustomerId;
string StartingDate;
string AccountType;
string AccountHolderFirstName;
string AccountHolderLastName;
}
class OpenAccountRequest
{
string CustomerId;
string StartingDate;
string AccountType;
string AccountHolderFirstName
string AccountHolderLastName
string JointAccountNumber;
}
Use flat structure, no nested objects
Nested objects only when using list
Business Readable Contract
Service operations are not methods
public interface PaymentGatewayService
{
bool Authorize(string cardNumber, string verifiedByVisaPassword);
bool Validate(string cardNumber, string holderName, string cvv);
bool PerformTransaction(string cardNumber, string holderName, string cvv, decimal amount
}
interface PaymentGatewayService
{
CreditCardPaymentResponse Process(CreditCardPaymentRequest request);
}
class CreditCardPaymentRequest
{
string CardNumber;
string CVVNumber;
string VBVPassword;
string HolderName;
string Amount;
}
class CreditCardPaymentResponse
{
string ErrorCode;
string ErrorDescription;
string TransactionReferenceNumber;
}
No parameters/return-value/exception
Late Binding over Fail fast
Service side validation over schema validation
Loose types over strong types
Error message over system exceptions
Also useful in versioning
Decouple Domain Entities
and Service Contract
Web Services
Database
User
Interface
Application
Data
Transfer
Objects
UI Model
Domain
Model
Extremely Common Architecture
OR
Mapping
objects
Writing different data definition and
mapping them
Can be quite tedious and error prone
What can we do?
Web Services
Database
User
Interface
Application
Data
Transfer
Objects
UI Model
Domain
Model
OR
Mapping
objects
Hibernate
How about?
Web Services
Database
User
Interface
Application
Domain
Model
Domain
Model
Domain
Model
Hibernate
Data
Transfer
Objects
UI Model
Shared Domain Model
public class Customer
{
int id;
Name name;
int age;
IList<Account> accounts;
}
public class Account
{
int id;
string number;
DateTime openingDate;
DateTime closingDate;
decimal balance;
IList<Transaction> transactions;
}
public class Transaction
{
int id;
DateTime date;
decimal amount;
TransactionType type;
}
public enum TransactionType
{
Credit,
Debit
}
public class Name
{
string first;
string middle;
string last;
string title;
}
Domain
Model
public class Customer
{
int id;
string firstName;
string middleName;
string lastName;
string title;
int age;
}
public class Customer
{
int id;
Name name;
int age;
}
public class Name
{
string first;
string middle;
string last;
string title;
}
Domain Model
Contract
Can tolerate this
public class Customer
{
string id;
string firstName;
string middleName;
string lastName;
string title;
string age;
}
public class Customer
{
int id;
Name name;
int age;
}
public class Name
{
string first;
string middle;
string last;
string title;
}
Contract
…even this
Domain Model
public class Customer
{
int id;
int customerId;
string firstName;
string middleName;
string lastName;
string title;
int age;
}
public class Customer
{
int id;
int customerId;
string firstName;
string middleName;
string lastName;
string title;
int age;
}
Contract
Encapsulate service internals
Domain Model
public class Customer
{
public string CustomerId { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public string Title { get; set; }
public string Age { get; set; }
}
public class Customer
{
int customerId;
string firstName;
string middleName;
string lastName;
string title;
int age;
}
Encapsulate Domain Model
Contract
Domain Model
public class Customer
{
public string CustomerId { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public string Title { get; set; }
public string Age { get; set; }
}
public class Customer
{
int id;
int customerId;
Name name;
int age;
}
public class Name
{
string first;
string middle;
string last;
string title;
Too much mismatch
Contract Domain
Model
Bad contract and domain
public class CustomerService
{
private readonly CustomerRepository customerRepository;
public CustomerService(CustomerRepository customerRepository)
{
this.customerRepository = customerRepository;
}
public Customer Get (CustomerServiceRequest request)
{
try
{
return customerRepository.LoadCustomer(request. Identification);
}
finally
{
customerRepository.Dispose();
}
}
}
Simple Service Implementation
public class Customer
{
Name name;
int age;
}
public class Customer
{
Name name;
IList<Account> accounts;
}
public class Account
{
decimal balance;
IList<Transaction> transactions;
}
public class Transaction
{
int id;
DateTime date;
decimal amount;
TransactionType type;
}
public class Customer
{
Name name;
IList<Account> accounts;
}
public class Account
{
string number;
decimal balance;
}
Customer Profile
Accounts Summary
Transactions Since
No control over data sent
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping >
<class name="Customer" table="Customers" lazy="true">
<id name="Id">
<column name="Id" not-null="true" />
<generator class="identity" />
</id>
<bag name="accounts" lazy="true" cascade="all-delete-orphan" access="field">
<key column="CustomerId" />
<one-to-many class="Account"/>
</bag>
</class>
<class name="Account" table="Accounts" lazy="true">
<id name="Id">
<column name="Id" not-null="true" />
<generator class="identity" />
</id>
</class>
</hibernate-mapping>
Serializing lazy domain object
Create
Session Load
Customer
Return
Customer
Close
Session
Get
Customer
Customer
Response
Lazy entities not loaded
Account 2
Id
Balance
Account 1
Id
Balance
Customer
Id
Name
Age
hacks…
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping >
<class name="Customer" table="Customers" lazy=“false">
<id name="Id">
<column name="Id" not-null="true" />
<generator class="identity" />
</id>
<bag name="accounts" lazy=“false" cascade="all-delete-orphan" access="field">
<key column="CustomerId" />
<one-to-many class="Account"/>
</bag>
</class>
<class name="Account" table="Accounts" lazy=“false">
<id name="Id">
<column name="Id" not-null="true" />
<generator class="identity" />
</id>
</class>
</hibernate-mapping>
isn’t this smart
public Customer Get(CustomerIdentification customerIdentification)
{
try
{
Customer customer = customerRepository.LoadCustomer(customerIdentification);
ForceLoad(customer);
return customer;
}
finally
{
customerRepository.Dispose();
}
}
private void ForceLoad(Customer customer)
{
customer.ToString();
customer.Accounts.ForEach(account => account.ToString());
//.....so on
}
no…may be should have used
reflection
Tradeoffs
Code reuse
Less code
Mapping simplicity
Design compromise
Decoupling
Control serialized data
Performance
vs
Thank you!

More Related Content

Viewers also liked

Agile, architecture and architects
Agile, architecture and architectsAgile, architecture and architects
Agile, architecture and architects
Vivek Singh
 
Simple design/programming nuggets
Simple design/programming nuggetsSimple design/programming nuggets
Simple design/programming nuggets
Vivek Singh
 
Effective use of time
Effective use of timeEffective use of time
Effective use of time
Vivek Singh
 
Product over project
Product over projectProduct over project
Product over project
Vivek Singh
 
Small is beautiful
Small is beautifulSmall is beautiful
Small is beautiful
Vivek Singh
 
Bahmni Introduction
Bahmni IntroductionBahmni Introduction
Bahmni Introduction
Vivek Singh
 
Bahmni, Scaling in multiple countries
Bahmni, Scaling in multiple countriesBahmni, Scaling in multiple countries
Bahmni, Scaling in multiple countries
Vivek Singh
 
EIT-Digital_Annual-Report-2015-Digital-Version
EIT-Digital_Annual-Report-2015-Digital-VersionEIT-Digital_Annual-Report-2015-Digital-Version
EIT-Digital_Annual-Report-2015-Digital-Version
Edna Ayme-Yahil, PhD
 
Structured Approach to Solution Architecture
Structured Approach to Solution ArchitectureStructured Approach to Solution Architecture
Structured Approach to Solution Architecture
Alan McSweeney
 

Viewers also liked (9)

Agile, architecture and architects
Agile, architecture and architectsAgile, architecture and architects
Agile, architecture and architects
 
Simple design/programming nuggets
Simple design/programming nuggetsSimple design/programming nuggets
Simple design/programming nuggets
 
Effective use of time
Effective use of timeEffective use of time
Effective use of time
 
Product over project
Product over projectProduct over project
Product over project
 
Small is beautiful
Small is beautifulSmall is beautiful
Small is beautiful
 
Bahmni Introduction
Bahmni IntroductionBahmni Introduction
Bahmni Introduction
 
Bahmni, Scaling in multiple countries
Bahmni, Scaling in multiple countriesBahmni, Scaling in multiple countries
Bahmni, Scaling in multiple countries
 
EIT-Digital_Annual-Report-2015-Digital-Version
EIT-Digital_Annual-Report-2015-Digital-VersionEIT-Digital_Annual-Report-2015-Digital-Version
EIT-Digital_Annual-Report-2015-Digital-Version
 
Structured Approach to Solution Architecture
Structured Approach to Solution ArchitectureStructured Approach to Solution Architecture
Structured Approach to Solution Architecture
 

Similar to Service Architecture patterns

introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
redaxe12
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
Richard Dingwall
 
Domain-Driven Design with SeedStack
Domain-Driven Design with SeedStackDomain-Driven Design with SeedStack
Domain-Driven Design with SeedStack
SeedStack
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
CHOOSE
 
Introduction to Event Sourcing and CQRS
Introduction to Event Sourcing and CQRSIntroduction to Event Sourcing and CQRS
Introduction to Event Sourcing and CQRS
Vladik Khononov
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
Jeriel_Mikell
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
google
 
Introduction to Event Sourcing and CQRS (IASA-IL)
Introduction to Event Sourcing and CQRS (IASA-IL)Introduction to Event Sourcing and CQRS (IASA-IL)
Introduction to Event Sourcing and CQRS (IASA-IL)
Vladik Khononov
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbs
Shakir Majeed Khan
 
Mind Your Business. And Its Logic
Mind Your Business. And Its LogicMind Your Business. And Its Logic
Mind Your Business. And Its Logic
Vladik Khononov
 
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
Soa Symposium   Expressing Service Capabilities Uniformly 2009 10 14 BcSoa Symposium   Expressing Service Capabilities Uniformly 2009 10 14 Bc
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
fuzzyBSc
 
Dont call me cache java version
Dont call me cache java versionDont call me cache java version
Dont call me cache java version
Avisi B.V.
 
Designing DDD Aggregates
Designing DDD AggregatesDesigning DDD Aggregates
Designing DDD Aggregates
Andrew McCaughan
 
Greg Demo Slides
Greg Demo SlidesGreg Demo Slides
Greg Demo Slides
Gregory Renard
 
Writing good code
Writing good codeWriting good code
Writing good code
Ishti Gupta
 
Contract First Modeling Services Using Uml
Contract First Modeling Services Using UmlContract First Modeling Services Using Uml
Contract First Modeling Services Using Uml
Rody Middelkoop
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
ellentuck
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
patinijava
 
Esposito Ajax Remote
Esposito Ajax RemoteEsposito Ajax Remote
Esposito Ajax Remote
ask bills
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
MarcinStachniuk
 

Similar to Service Architecture patterns (20)

introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
Domain-Driven Design with SeedStack
Domain-Driven Design with SeedStackDomain-Driven Design with SeedStack
Domain-Driven Design with SeedStack
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
 
Introduction to Event Sourcing and CQRS
Introduction to Event Sourcing and CQRSIntroduction to Event Sourcing and CQRS
Introduction to Event Sourcing and CQRS
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
 
Introduction to Event Sourcing and CQRS (IASA-IL)
Introduction to Event Sourcing and CQRS (IASA-IL)Introduction to Event Sourcing and CQRS (IASA-IL)
Introduction to Event Sourcing and CQRS (IASA-IL)
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbs
 
Mind Your Business. And Its Logic
Mind Your Business. And Its LogicMind Your Business. And Its Logic
Mind Your Business. And Its Logic
 
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
Soa Symposium   Expressing Service Capabilities Uniformly 2009 10 14 BcSoa Symposium   Expressing Service Capabilities Uniformly 2009 10 14 Bc
Soa Symposium Expressing Service Capabilities Uniformly 2009 10 14 Bc
 
Dont call me cache java version
Dont call me cache java versionDont call me cache java version
Dont call me cache java version
 
Designing DDD Aggregates
Designing DDD AggregatesDesigning DDD Aggregates
Designing DDD Aggregates
 
Greg Demo Slides
Greg Demo SlidesGreg Demo Slides
Greg Demo Slides
 
Writing good code
Writing good codeWriting good code
Writing good code
 
Contract First Modeling Services Using Uml
Contract First Modeling Services Using UmlContract First Modeling Services Using Uml
Contract First Modeling Services Using Uml
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
 
Web Services Part 2
Web Services Part 2Web Services Part 2
Web Services Part 2
 
Esposito Ajax Remote
Esposito Ajax RemoteEsposito Ajax Remote
Esposito Ajax Remote
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 

Service Architecture patterns

Editor's Notes

  1. Webservices get requests from the client, converts them to domain objects with the help of mappers/repositories, call services with these domain objects, these services orchestrate the domain logic and they will use the repository to write to the database
  2. monolithic architecture diagram (also draw front end box) test, deploy....no decoupling....small pieces, easier to understand, can be worked upon independently.
  3. Customer/Accounts and Transactions. Caching, batched request might work. Sometimes join at database level is the only resolution.
  4. Opening account with starting balance. AccountService and TransactionService
  5. Multiple domain representation Need to fix write ownership Services coupling via database
  6. We haven’t used sub-classes
  7. Accidental or essential
  8. Add more members
  9. Need code sample for Dynamic Proxy here.
  10. I still have duplication. And I have to modify my equals method to look at any new members added – this is error prone. Equals might have a specific meaning – Id equality for example. Use a method like MemberEquals.
  11. Complicated to implement – with lists, nested objects.
  12. Easy to implement. Memory intensive if you have a deep object graph - Avoid deep object graphs on the UI. Or clone only that portion of the object graph which is different – problem: You’ll need a special equals which you have to keep in sync when new members are added, etc.
  13. Should this be CLOBs and/or BLOBs in the DB?
  14. If the XML Schema changes or if the Class definition changes. When could you use it: if the data is stored only for reference (eg:. Quotes from the quoting engine are valid for 30 days if the accompanying XML response is stored untampered for that period) - probably store the digitally signed message from the other system. Might consider also storing the data in a normalised form if you need to do anything else with it. Storing presentations/attachments - if the object is really large, consider moving it out of the DB and on to the file system with a reference to the location. Problem with this is that you are trading off the DB performance/size with consistency issues and more complexity dealing with two different places where the truth is stored. pros: performance and development simplicity Eg: Insurecom - we were getting XML from a quoting engine. Had to update the XML with new values and send it across. The logic to do this became fairly painful even tho' we only had to update a couple of places in the XML. Also we only ever had to deal with one policy at a time - the user never wanted to deal with all the policies which have a risk rating above 0.8 in one shot, etc.
  15. Eg. Quotes from a quoting engine are valid for 30 days if the accompanying XML response is stored untampered for that period – you probably want to store the message signed by the quoting engine’s private key in your DB as a BLOB. If the blob is really large, consider storing it outside the DB with a link to the location.
  16. Should this be CLOBs and/or BLOBs in the DB?