Podcast
Questions and Answers
Design patterns help realize architecture
Design patterns help realize architecture
True (A)
What does B2C stand for in the context of an online store?
What does B2C stand for in the context of an online store?
Business to consumer
Top layer uses the services defined by the bottom one.
Top layer uses the services defined by the bottom one.
False (B)
Lower layer is aware of the top layer.
Lower layer is aware of the top layer.
We only need to know 1st layer below, independently from others below.
We only need to know 1st layer below, independently from others below.
Extra layers may reduce performance.
Extra layers may reduce performance.
Name the three layers found in a 3-layer architecture.
Name the three layers found in a 3-layer architecture.
Give an example of a technology used for the presentation layer of a 3-layer architecture.
Give an example of a technology used for the presentation layer of a 3-layer architecture.
Give an example of a technology used for the data source layer of a 3-layer architecture.
Give an example of a technology used for the data source layer of a 3-layer architecture.
What is the purpose of the domain logic layer in a 3-layer architecture?
What is the purpose of the domain logic layer in a 3-layer architecture?
Why is layers separation useful even only on one computer?
Why is layers separation useful even only on one computer?
Give an example of something that could be done on the client side to improve responsiveness.
Give an example of something that could be done on the client side to improve responsiveness.
What is the simplest domain logic pattern?
What is the simplest domain logic pattern?
The Domain Model pattern works well with simple data.
The Domain Model pattern works well with simple data.
The more complex the domain, the easier to map to relational databases.
The more complex the domain, the easier to map to relational databases.
What pattern is designed to operate with "Record Set"?
What pattern is designed to operate with "Record Set"?
Which of the following interface types is almost universal and platform independent?
Which of the following interface types is almost universal and platform independent?
Name a type of program with HTTP processing capabilities that outputs HTML strings.
Name a type of program with HTTP processing capabilities that outputs HTML strings.
What receives the response using HTTP session object and displays it?
What receives the response using HTTP session object and displays it?
Which pattern's page structure defines presentation, with markers to include executable code for dynamic content?
Which pattern's page structure defines presentation, with markers to include executable code for dynamic content?
Which view pattern is based on a transformation language like XSLT for XML data?
Which view pattern is based on a transformation language like XSLT for XML data?
If you use the Two Steps View pattern, how many second steps will there be?
If you use the Two Steps View pattern, how many second steps will there be?
What isolates the responsibilities to process and serve HTTP requests and to decide what to do with them?
What isolates the responsibilities to process and serve HTTP requests and to decide what to do with them?
Name an alternative to object DBs.
Name an alternative to object DBs.
What is the basic pattern for Row Data Gateway and Table Data Gateway?
What is the basic pattern for Row Data Gateway and Table Data Gateway?
If technology platform supports data recovery pattern _______, then it is easier to use Table Data Gateway.
If technology platform supports data recovery pattern _______, then it is easier to use Table Data Gateway.
What pattern is appropriate when the domain model is similar to the database schema?
What pattern is appropriate when the domain model is similar to the database schema?
What is registered by Unit of Work?
What is registered by Unit of Work?
Which pattern controls what is read?
Which pattern controls what is read?
_________: special field in the object keeping its identify, helps mapping between between objects and relational DB keys.
_________: special field in the object keeping its identify, helps mapping between between objects and relational DB keys.
Name an option for storing inheritance.
Name an option for storing inheritance.
Class Table Inheritance is very flexible/extensible, and efficient
Class Table Inheritance is very flexible/extensible, and efficient
Single Table Inheritance: a lot of duplication and table affected by each domain change, but very efficient, without JOINS.
Single Table Inheritance: a lot of duplication and table affected by each domain change, but very efficient, without JOINS.
What facilitates the reuse of mapping tools?
What facilitates the reuse of mapping tools?
Name a problem to avoid when dealing with concurrence.
Name a problem to avoid when dealing with concurrence.
Name the process of coordinating requests accessing same data to avoid concurrency issues.
Name the process of coordinating requests accessing same data to avoid concurrency issues.
What's a mechanism to avoid problems in concurrence?
What's a mechanism to avoid problems in concurrence?
What are possible Measures of concurrency control?
What are possible Measures of concurrency control?
In ____ locking the focus is on detecting conflict
In ____ locking the focus is on detecting conflict
What kind of lock requires reading?
What kind of lock requires reading?
What is the main concurrency control tool in enterprise applications?
What is the main concurrency control tool in enterprise applications?
Give an example of a business transaction
Give an example of a business transaction
Concurrence patterns for transactions spanning more than one request.
Concurrence patterns for transactions spanning more than one request.
The main goal of distributed objects, is minimize distribution degree but with efficiency problems
The main goal of distributed objects, is minimize distribution degree but with efficiency problems
What should we differentiate for callable objects?
What should we differentiate for callable objects?
______ interface: for local calls, many methods with simple functionality. No problem if many calls needed.
______ interface: for local calls, many methods with simple functionality. No problem if many calls needed.
_____ interface: for remote calls, methods provide complex functionality, minimize number of calls.
_____ interface: for remote calls, methods provide complex functionality, minimize number of calls.
Name one of the Distributed Objects Patterns
Name one of the Distributed Objects Patterns
Flashcards
What is a Pattern?
What is a Pattern?
Describes a common problem and guidelines to solve it. It provides practical foundations and can have different specific solutions for the same pattern.
Layered Architecture
Layered Architecture
A common approach to decompose a complex problem, where the top layer uses services defined by the bottom layer, and the bottom layer is unaware of the top layer.
Presentation Layer
Presentation Layer
The logic of user-application interaction, examples including command lines, menus, rich clients, and HTML.
Data Sources Layer
Data Sources Layer
Signup and view all the flashcards
Domain Logic Layer
Domain Logic Layer
Signup and view all the flashcards
Transaction Script
Transaction Script
Signup and view all the flashcards
Domain Model
Domain Model
Signup and view all the flashcards
Table Module
Table Module
Signup and view all the flashcards
Web Presentation
Web Presentation
Signup and view all the flashcards
Controller (MVC Pattern)
Controller (MVC Pattern)
Signup and view all the flashcards
Template View
Template View
Signup and view all the flashcards
Transform View
Transform View
Signup and view all the flashcards
Page Controller / Front Controller
Page Controller / Front Controller
Signup and view all the flashcards
Mapping to Relational DB
Mapping to Relational DB
Signup and view all the flashcards
Gateway Pattern
Gateway Pattern
Signup and view all the flashcards
Active Record Pattern
Active Record Pattern
Signup and view all the flashcards
Unit of Work
Unit of Work
Signup and view all the flashcards
Concurrence
Concurrence
Signup and view all the flashcards
Optimistic Locking
Optimistic Locking
Signup and view all the flashcards
Remote Facade & Data Transfer Object
Remote Facade & Data Transfer Object
Signup and view all the flashcards
Study Notes
- The content discusses patterns for enterprise software architecture, covering topics from basic principles to distributed applications, database mapping, concurrency, and presentation layers.
Introduction
- The objective involves structuring business applications
- Architecture is defined to be the main application parts and their connections
- Architectural patterns involve important decisions about these parts
- Design patterns should help realize that architecture
Sample business application
- Online store (B2C) with many users, simple business logic, generic web interface, and a database for orders and inventory is a sample application
- Processing house renting is characterized by few users, complex business logic and user interfaces, and a database integrated with external packages for valuations and credit checking
- Small company expenses management is defined by few users, simple logic and scalability, but it also mentions being integrated with complex applications
- A pattern describes a common problem and provides guidelines for solving it on practical foundations
- Solutions can differ on solutions while addressing the same pattern
Layered Architecture
- Layered architecture is a common approach to decompose complex problems, a top layer usually uses services from a bottom layer without a response, bottom layer hides internal levels.
- Benefits include needing to know only the layer below, independent layers that can be replaced with implementations, minimized dependencies, and layer reuse
- Increased risk of cascading changes, performance hits from extra layers, and difficulty in dividing functionality constitute disadvantages
- Presentation is the logic of user application interaction
- Data sources communicate with data providing systems
- Domain logic involves application specific functionality
- The client and the server must decide where layters should be operated for benefits like upgradeability, maintainablity, responsiveness and also offline operation.
Transaction Script
- It is a domain logic pattern for processing, storing/retrieving, invoking other systems, and responding, as is the case in an online store
- It offers a simple procedural model that works well with simplistic data, but disadvantages include incompatibility with complex domain logics
- Domain Model disadvantages include the use of objects to provide suitability for complex data
- Table Module is designed to operate with Record Sets as a compromise between these approaches
- Record is structured around tables, less structured than other OO data, however ideal for things such as .NET
Remote Interfaces to Domain Logic
- Main remote interface forms of HTTP is defined through browsers or web-service formats (HTML, JSON, XML) for message content (universal, easy to deploy), or OO using CORBA, ActiveX, Java RMI (explicit interface)
Web Presentation
- Web Presentation based on web browsers offers universal access and no software installs
- Servers interpret URLs and pass control to applications
- Main structure involves programs such as CGIs or Java Servlets and server pages (HTML and code templates)
- Applying the Model View Controller pattern involves a controller receiving a request, redirecting to a model object, which queries data sources and returns to a controller for the view and displays
View Patterns
- Three patterns for views include Transform, Template, and Two Step
- Template Views define the presentation and are usual for server pages that need easy development but messy code
- Transform Views bases on languages such as XSLT for XML data and can adapt to formats or devices with complexity
Controller Pattern
- In controller patterns, a page controller is an object for each page, while a front controller isolates the responsibilities to process HTTP requests
- Centralized request management is an advantage here
Mapping to Relational DB
- Storing objects in relational DBs faces challenges due to structure differing objects, so object DBs are an alternative
- Mapping for relational DBs can be achieved through Row Data Gateways, Table Data Gateways, Active Records, and Data Mappers
- Gateways are basic patterns mapping classes to database tables
- Patterns contain all the mapping code, but not domain logic
- It should be appropriate for the domain model to be similar to the database schema, combining aspects, although these responsibilities should be seperate
- Data mappers are more complex and flexible, allowing domain objects to be independent from the DB schema
Concurrence
- The topic lists: loading, saving, tracking changes and guaranteeing persistence that avoids loaded objects being concurrently edited in a database
- Unit of Work registers loaded and modified objects; otherwise, domain layer must decide reads and writes
Data Reading
- Mapping classes encapsulate SQL for object-relational mapping, using Identity Map to control what is read
- Mapping data structures faces issues with links (foreign keys) and collections (individual values)
- Identity Fields keep the objects identity to map between databases and objects
- A common relational database has no inheritance mechanism
- Options in mapping is limited to a single table (all classes) or a set of connected tables
- Metadata Mapping facilitates the reuse of mapping tools using files/annotations
Concurrence
- Concurrence is where multiple processes manipulate the same data, but creates issues
- Interaction problems, can be avvoided within a transaction or problems will occur
- Offline-concurrence can span multiple transactions
- You would require things to avoid concurrency mechanism in order not to lose updates or have inconsistent readings
Execution Contexts
- Requests or sessions can be interaction contexts
- Processes offer heavy weight context, and threads are a more lightweight context and transaction coordinate things in DBs
- Isolation is a mechanism to avoid problems, using examples such as operating system memory access or file locks
- Shared data can coordinate concurrently
- Concurrency control can be optimistic or pessimistic
Concurrency Control
- Optimistic locking detects conflicts, while pessimistic locking is focused on a way to prevent any conflicts
- Optimistic locking works best with rare infrequent conflicts and a higher concurrency, with pessimistic locking as default for major conflicts
- Pessimistic locks avoid inconstistent readings through read locks (shared by readers) and write locks (exclusive)
- Pessimistic locking lead to deadlocks, requiring detection/fixes or order blocks
Transactions
- Transactions are the main concurrency control tool, with each applied to DBs, message queues, printers, etc
- Atomicity, consistency, isolation, and persistence are key properties
- System transactions use SQL commands, while business transactions happen at a higher level
Business Transactions
- They span multiple request/responses, and its hard to handle concurrency, or they can lock the system
- Atomicity and persistence are achieved at a user-agreed moment
- Consistency involves the application implementing business rules, with isolation using session controls
- Offline concurrency control is defined as more complex
- Easier to implement and efficient, but detects conflict at the end
Distributed Applications
- Objects from application design become components, with each executed on different nodes
- For distributed objects, differentiate local (multiple simple methods) and remote interfaces (fewer complex methods)
- Minimizing calls and avoiding distributed objects are recommendations
- Local Interfaces for local calls, many methods with simple functionality
- Remote Interfaces for remote calls, methods provide complex functionality, minimise number of calls
- An alternative to that would be scaling up with more application replicas
Distribution Scenarios
- Remote calls are unavoidable between client and server or application server and database
- Remote Facade can group methods of a remote interface
- Data Transfer Objects offer simplified versions of remote objects used to reduced data sent
Putting Into Practice
- Steps for using patterns while developing, using the techincal platform and the domain layer: Transaction Script, Table Module and Domain Model, however Domain Models can require relational databases
- In Transaction Script, the platform uses a database with Row/Table Gateways
- Minimising concurrency problems and corresponding to a system transaction
- Exception needs load data, edit it using Optimistic Offline Lock
- Data access layers uses relational mapping too and a single database table to use multiple classes (inheritance) and class table, use a table per class
- In Table module, the best choice is to use Record Set
- Presentation-Layer can use rich client-side frameworks, and the model can be domain.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.