SW - Oral Exam Flashcards
3 rules of composition
- the whole can’t exist without the parts
- each part may only be in one composite at any one time
- composition generally heteromeric (i.e., mixed types)
Aggregation - 3 attributes
- Aggregate (child) may exist without constituent objects (even though this may seem weird)
- At any time, objects may be constituents of two or more aggregates
- Aggregation tends to be homeomeric - i.e., of uniform type
0, 1, or infinity principle
Multiplicity
Always indicate multiplicity
Avoid “” as a multiplicity - use 0..””, 1..”*” , etc. as appropriate
Behavior diagrams?
2 types?
Show operations represented with states, transitions, and guards
State diagrams
o Shows the operation of a single sequential process
Activity diagrams
o Designed for concurrent processes
What are 3 Views used to depict the structure of the architecture?
- Module views show how the system is structured as a set of code units.
- Component-and-connector (C&C) views show how the system is structured as a set of elements with runtime behaviors and interactions.
- Allocation views show how the system relates to non-software structures in its environment.
Deployment Views
The deployment view shows how the software elements of a system are deployed to the hardware elements.
RPC vs REST
RPC - directs requests to procedures/ APIs
- more about the actions
- used to communicate across the different modules to serve user requests
REST (Representational State Transfer) - directs requests to resources
- works with the resources
- it is a simple way to organize interactions between independent systems
Tiered computing
Multilayer client-server, where intermediate layers preprocess client requests and/or postprocess server responses: e.g.,
- preprocessing of requests: client authentication; translation of client request from a format the client uses to a format that the server requires
- postprocessing of responses: translation of server response from a format the server uses to a format that the clent requires
- both: using cached responses at intermediate hosts along client-server communication path to reduce request latency
Broker
- Allows for dynamic bending between client and server provider
- Less overhead and more performance than Proxy
A form of tiered computing where an intermediate host, the broker, intercepts the initial request, then puts a client in direct contact with a server
Proxy
- Shields server(s) from dynamic binding
- More secure than Broker
Allows an object to substitute for another object, fielding requests on the second object’s behalf
A form of tiered computing where an intermediate host, the proxy, handles all communication between client and server
MVC
A form of tiered computing where the intermediate layer, the controller, resides on the server and handles all communication between UIs (views) and a back-end dataset (model)
MVP
like MVC, except that the controller, now referred to as a presenter, resides on the client
Tiered computing?
Examples?
- Generalization of client-server computing
- uses intermediate layers or levels of logic to address specialized concerns, typically pertaining to business rules or implementation
- servers provide services by acting as clients to lower-level services
Classic example: middleware
• User application calls middleware service:
e.g., ASP.NET, PHP, CORBA
• Middleware service authenticates user, calls underlying database – whatever
Classic client-server vs. broker, proxy
simplicity: more straightforward than broker or proxy
performance: requires no initial or intermediate communication with front-end request manager
Broker vs. client-server
Flexibility, scalability: allows service provider to route all requests to any server at the start of a dialogue
Broker vs proxy
Performance: less overhead for multi-message dialogues
Proxy is more security: hides server(s) from client throughout dialogue
Same
o Both are forms of tiered computing
Different
o Broker is an internal host which intercepts the initial request that puts clients in direct contact with the server
o Proxy handles all communication between the server and the client
Proxy vs client-server
Flexibility, scalability: allows service provider to route any requests to any server AT ANY POINT in a dialogue
Proxy vs broker
security: hides server(s) from client throughout dialogue
Shared data viewtypes
Commonality: support many-to-many communication via a common store
C&C types (3)
Request-response-based viewtypes
• What they have in common
all provide (asymmetric) service from a responder to a requestor: i.e.,
• Requestor sends request in form of message
• Some back-end service provider responds to the request
• How they differ
How the message is communicated to the service provider
Basic principle: adding intermediaries for managing communications adds flexibility, at a cost of additional overhead
• Classic client-server
• Tiered computing
• Broker
• Proxy
Shared data viewtypes • Commonality: support many-to-many communication via a common store • Differences involve How participating entities obtain content from the store: i.e., • Via pull / polling (repository) • Via push (blackboard) How content in the store is named How content in the store persists: i.e., whether it's automatically removed after being communicated to participating entities • Repository • Tuple space • Blackboard • Model-View-Controller • Publish-subscribe • Distribution tree
Other
Pipe and filter
Peer-to-peer
Module viewtypes
module: code unit that covers set of responsibilities
e. g.: collection (package) of classes, class, layer, function
depicts static system composition
Types • Layered • Decomposition • Use • Generalization • Aspects
Allocation viewtype
mapping of software units to environment where software resides:
e.g., hardware, development team, file system.
Types
• Deployment style: where modules will be physically deployed
• Work assignment style: what modules will do what work
less detailed than work breakdown structures
• Implementation style: where module codes will be stored
MVC
Model
o The app’s content
o Repository and resides on a server. “What it is.”
View
o The app’s appearance.
o Shows repository context and resides on the client. “What it looks like.”
Controller
o The app’s functionality
o Resides on server. “What it is.”
MVC vs MVP
Same
o Controllers reside on servers. Presentation resides on clients
o Both have models and views to display output
Differ in leveling
o Passive MVP is layered
o MVP uses a presenter instead of a controller which instead resides on the client.
o MVC is leveled (the model communicates changes to views directly)
o With MVC, the interm layer is the controller which resides on a server and handles all communication between the views and models
o The strategy is to determine if it’s more feasible for the brain to be on the client or the server
Repository vs Publish-Subscribe
Same
o Both share communication
Different
o Publish-subscribe supports a 1-way flow of message for publishers to subscribers
o Shares multiple ways
Publish-Subscribe vs Distribution Tree
Same
o Both support messages from publisher to subscriber
Different
o Distribution tree has a tiered backend distribution service that eliminates potential bottleneck at server due to massive number of clients
Blackboard vs Repository
Similar
o Both support communication by multiple processes
Different
o Repository: the processes are through a shared persistent store which is passive
o Blackboard: the store is active and changes to the blackboard trigger events in process
Code-first development
- Involves modeling the application entities using code, or an ORM
- Preferred when developers are not interested in the database or the database is expected to have a short lifetime
Data-first development
- The classic strategy for implementing a database
- The data models are developed first
- Suggested if the developers have experience in database design
REST’s Put vs Post
- Put – used for creating a new response
* Post – used for updating an existing source
Constantine’s
Functional cohesion hierarchy
• Functional - 1 well-defined task, strongest type of cohesion
• Sequential - 1 sequence of subtasks for 1 well-defined task
o sequence of tasks to get to a single outcome. Add A+B then add B+C
• Communicational - 1 set of subtasks for 1 well-defined task
• Procedural - 1 sequence of subtasks across 2 or more tasks
• Temporal – 1 set of concurrent subtasks across 2 or more tasks
o tasks that are loosely related within a routing and are together due to timing
• Logical - multiple, superficially related tasks
o tasks within a routine that make logical sense, but don’t make functional sense
• Coincidental - multiple, unrelated tasks
o tasks that are not related at all and are within the same function for no reason
Constantine’s
Coupling hierarchy
From loosest (best) to tightest (worst) First four cases: function interface characterizes all sharing
- Null – where routines don’t share data – loosest coupling
- Data – only a single data is being passed between routines
- Stamp – an entire structure is shared, including data that’s not needed
- Control – sharing of parameters that direct behavior
- External – sharing of external storage such as a database. It’s best not to create a copy, but instead should pass data
- Common – data shared between the namespace. This can affect other functions if the data is changed.
- Global – sharing via global variables
- Content coupling – where routines are aware of each other’s implementation – strongest coupling
Relationship between tiered computing and the client-server architecture style
Client server - may have one or multiple distributed servers.
o The architecture assumes the client either knows types, locations of servers, or can discover these before initiating servers.
o Has emphasis on request-response based processing with backend service providers
Tiered computing – a generalization of client-server
o Uses intermediate logic/levels of logic to address specialized concerns. Example is middleware
o Uses a multilayer client-server where intermediate layers preprocess client requests and/or postprocess server responses
Krutchen
4+1 computer architecture
- Logical – models end user viewpoint (functional, UML class)
- Development – programmer’s static viewpoint (implementation, UML package)
- Process – programmer’s dynamic viewpoint (dynamic behavior, UML activity)
- Physical – system engineers (typology of components, UML deployment)
Wirfs-Brock, McKean
2 components of Responsibility-Driven Design
- Actors = candidates
* Responsibilities = what they do
Wirfs-Brock, McKean
What are the 6 actors and responsibilities?
- Information holder - object that primarily knows facts
- Structurer - pools, collects, manages other objects, presenting coherent views of groupings
- Service provider - provides special skills or computation
- Controller - makes decisions, directs others’ actions
- Coordinator - manages actions of groups of workers, relaying information and calling on others to act
- Interfacer - bridges naturally disjoint components
5 essential characteristics of an object
- Identity
- Behavior
- Lifetime
- Interface
- State
Model inheritance
- Reflects is-a relations between abstractions in a model
* May be the only valid reason for employing inheritance