DOC PREVIEW
UT Dallas CS 6359 - S21_Chapter_36

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1What will we learn?Expanding NextGen POSFailover to Local ServicesFailover to Local ServicesFailover to Local Services: Design For ProductDescriptionFailover to Local Services: Design For ProductDescriptionSlide 8Failover to Local Services: Design For ProductDescriptionSlide 10Slide 11Slide 12Handling FailureHandling Failure: Throwing ExceptionsHandling Failure: Throwing ExceptionsHandling Failure: Throwing ExceptionsSlide 17Handling Failure: Handling ExceptionsHandling Exceptions: UI Object LogicProxySlide 21ProxySlide 23Proxy, Façade, Adapter?Proxy, Façade, Adapter?Abstract FactoryAbstract FactorySlide 28Standardized InterfacesAbstract FactoryAbstract FactorySlide 32Polymorphism and Do It MyselfPolymorphism and Do It MyselfSlide 35Slide 36Next …Object-Oriented Analysis and DesignCHAPTER 36: MORE OBJECT DESIGN WITH GOF1What will we learn?We will continue to iterate on the case studies, enhancing our designs by using more GoF patterns2Expanding NextGen POSWe are expanding the NextGen POS case study to include the following new features:Failover to a local service when the remote service failsLocal cachingSupport for third-party POS devices, like scannersHandling of credit, debit, and check payments3Failover to Local ServicesWe need a robust recovery from remote services (tax calculator, inventory system, etc.) failure Robust recovery from remote product database (descriptions, prices) failureFor performance reasons and to improve recoverability, the architect recommends using local caching for ProductDescription objectsThe cache can be a simple file located on a local hard driveThe System should check the cache before attempting a remote database access 4Failover to Local ServicesFor external services like the tax calculator, architect may suggest that simplified rules be kept in a local tax calculator for backupInventory updates can be locally stored and updated upon reconnectionFor reconnection scenarios for remote services, use smart Proxy objects that first try to reconnect to the remote services and redirect when possibleNote that many of these decisions are architecture decisions that would be made by the lead architect for the system, not necessarily the software designers5Failover to Local Services: Design For ProductDescriptionWe will create a local product information service, and the ServicesFactory will always return an adapter to this local serviceNote that the local products “adapter” is not really an adapter at all; it does not adapt an external service, it simply implements the responsibilities for the local servicesIt will appear as another adapter to the systemIn the design, we will initialize the local products information service to a reference to a second adapter of the true remote product serviceIf the local products information service finds the product information in its cache, it returns it; otherwise, it forwards the request to the adapter for the external service6Failover to Local Services: Design For ProductDescriptionWe can enhance the design of the local products information services by adding two levels of client-side caching:First, we have the persistent (hard disk) cache – this is implemented in the LocalProducts object that implements the IProductsAdapter interfaceNote this object implements a method called remoteProductsService (typed to the interface) that allows the object to invoke the getSpecification method on the external serviceAlso, we note that the ProductCatalog may be designed to maintain an in-memory collection of ProductDescriptions. These descriptions may be retrieved from the LocalProducts object, but to do this, the ProductCatalog (which is created by the Store) must have visibility to LocalProducts78«interface»IProductsAdaptergetSpecification( itemID ) : ProductSpecificationDBProductsAdaptergetSpecification( itemID )LocalProductsremoteProductsService: IProductAdaptergetSpecification( itemID )BigWebServiceProductsAdaptergetSpecification( itemID )11Implements the adapter interface, but is not really an adapter for a second component.Rather, it itself implements the local service function.ProductCatalogproductsService : IProductAdaptergetSpecification()11Failover to Local Services: Design For ProductDescriptionThe following communication diagrams show how the objects can be createdNote that the ProductCatalog asks the ServicesFactory for a reference to the LocalProducts object, so it can create the local in-memory cacheThe ServicesFactory first creates the adapter for the external service (DBProductsAdapter) and then creates the LocalProducts object, passing a reference to the external services objectRecall, the local services object will first check to see if the product description is cached and if not it will then access the external systemThe second slide shows the message sequence when a line item is enteredNote the ProductCatalog will first see if it has the description cached, and if not refer to the local “adapter” (which may eventually refer to the external service for the description)910:Store :Registerpc:ProductCatalogcreate2: create(pc) 1: create1:ServicesFactorypsa : LocalProductsexternalService :DBProductsAdapter1.1: psa = getProductsAdapter()1.1.2: create( externalService )1.1.1: createthe local service gets a reference to the adapter for the external servicethe local service is returned112: makeLineItem(ps, qty)enterItem(id, qty)1: ps = getDescription(id)1.1: ps = get(id)1.3 [not in descriptions & not full] : put( id, ps ):Register :Sale:ProductCatalog: LocalProducts1.2 [ not in descriptions ]: ps = getDescription(id) continued in another diagramdescriptions: Map<ProductDescription>12: LocalProducts remoteService :DBProductsAdapter: KeyIndexedFileOfSerializedObjects1: ps = get( id )3 [not in file ]: put( id, ps )ps = getDescription(id) 2 [not in file] :ps = getDescription(id) continued in another diagramHandling FailureTerminology:Fault: The ultimate origin or cause of a misbehavior (e.g. equipment failure, connection lost)Error: A manifestation of the fault in the running system. Errors may be detected (or not). Example would be what happens when the system tries to access an external system and the internet connection is down – system usually indicates some kind of error.Failure: A denial of service caused by an error (e.g., the Credit Authorization service fails to provide the authorization service)We are concerned with how the system handles errors – how does the fault manifest


View Full Document

UT Dallas CS 6359 - S21_Chapter_36

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture4

Lecture4

48 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download S21_Chapter_36
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view S21_Chapter_36 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view S21_Chapter_36 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?