Building End-to-End Multi-Client Service Oriented Applications - - PowerPoint PPT Presentation

building end to end multi client service oriented
SMART_READER_LITE
LIVE PREVIEW

Building End-to-End Multi-Client Service Oriented Applications - - PowerPoint PPT Presentation

Building End-to-End Multi-Client Service Oriented Applications Module 03 Architecture & Database of the Car Rental System Database Account Car Reservation AccountId CarId ReservationId LoginEmail Description AccountId


slide-1
SLIDE 1

Building End-to-End Multi-Client Service Oriented Applications

Module 03 Architecture & Database of the Car Rental System

slide-2
SLIDE 2

Database

Account

  • AccountId
  • LoginEmail
  • FirstName
  • LastName
  • Address
  • City
  • State
  • ZipCode
  • CreditCard
  • ExpDate

Car

  • CarId
  • Description
  • Color
  • Year
  • RentalPrice

Rental

  • RentalId
  • AccountId
  • CarId
  • DateRented
  • DateReturned
  • DateDue

Reservation

  • ReservationId
  • AccountId
  • CarId
  • RentalDate
  • ReturnDate

webpages_*

  • webpages_Membership
  • webpages_OAuthMembership
  • webpages_Roles
  • webpages_UsersInRoles

Any table whose records are account-specific, includes AccountId. (no multi-joins to get to Account) Will explain further in “Entities”

slide-3
SLIDE 3

Core Use Cases

  • As a customer

Reserve an available car for a given set of dates

Cancel an existing reservation

View rental history

  • As a Car Rental employee

Manage inventory of cars

Rent a reserved car to a customer

Accept a returned car from a customer

View customer and rental history list

slide-4
SLIDE 4

Service Decomposition

Inv nvent ntory Rental al Acco ccount

  • Vehicle CRUD
  • Vehicle availability
  • Vehicle reserve
  • Reservation cancel
  • Vehicle rental
  • Rental return
  • Current rentals
  • Dead reservations
  • Customer list
  • Account update
  • View account info

Ser ervices c can hit n hit bus business engi engine ne f for beha r behavior r reus eusability

  • r

r da data r repo epository f for r stra raight da data I I/O

slide-5
SLIDE 5

Security

Web b Site WCF CF Service ices We Web API

  • Forms Authentication
  • Secures site & API

Validate Authorization by user:

  • Site user to be passed in every service call and account compared to data being retrieved.
  • Ex: User1 may be authenticated but should not be able to retrieve data for User2
  • Web API calls also use similar facility

Deskt ktop

  • Windows Authentication
  • Dedicated App User
  • Dedicated Admin Role
slide-6
SLIDE 6

Car Rental System Architecture

Dat ata R a Repositories SQ SQL Se Server D DB cli lient s sid ide server s side

  • Misc. D

. DTO TOs Dat ata R a Repository Factory ry

Dat Data Ac Access L Lay ayer Dat Database L Lay ayer

WC WCF Se Services Servic ice Contra racts Other D Dat ata a Contra racts * * Server er-side de Entit itie ies WC WCF Se Service H Host

Busi siness S ss Service L Layer

Servic ice Factorie ies Service C Contr tracts ts Other D Dat ata a Contra racts * * ASP.N .NET T MVC MVC Clie ient ASP.N .NET T MVC MVC Kno nockout ut C Client nt WP WPF Desktop C Client ASP.N .NET W T Web API REST S T Serv rvices Core re F Fra ramework rk MEF D DI Contain ainer Ge Gene neral P Purp urpose Bus usine ness Engine nes * * Clie ient-si side Entit itie ies WC WCF Proxie ies

slide-7
SLIDE 7

Car Rental System Architecture

Dat ata R a Repositories SQ SQL Se Server D DB cli lient s sid ide business s side

  • Misc. D

. DTO TOs Dat ata R a Repository Factory ry

Dat Data Ac Access L Lay ayer Dat Database L Lay ayer

WC WCF Se Services Servic ice Contra racts Other D Dat ata a Contra racts * * Server er-side de Entit itie ies WC WCF Se Service H Host

Busi siness S ss Service L Layer

Servic ice Factorie ies Service C Contr tracts ts Other D Dat ata a Contra racts * * ASP.N .NET T MVC MVC Clie ient ASP.N .NET T MVC MVC Kno nockout ut C Client nt WP WPF Desktop C Client ASP.N .NET W T Web API REST S T Serv rvices Core re F Fra ramework rk MEF D DI Contain ainer Ge Gene neral P Purp urpose Bus usine ness Engine nes * * Clie ient-si side Entit itie ies WC WCF Proxie ies

Flatter model

(services and down-layers don’t call for deep, totally encapsulated business objects)

Strict Line of Separation

(clients will ONLY communicate With services and have no knowledge of anything else)

Lack of Pass-Through

(no unnecessary objects just for data-passing purposes)

Muti-Use Entities

(entities on each side used for multiple purposes – see ‘lack of pass-through’)

Testable Code

(all code layers developed with testability in concerns in forefront)

Use of DI Throughout

(both business-side & client-side will benefit from dependency injection)

slide-8
SLIDE 8

End of module

LET’S GET TO SOME SERIOUS CODING !