Class 2 - Software Architecture Flashcards
Greenfield Engineering
Designing a system from scratch (top-down)
Brownfield Engineering
Designing a system using a bunch of pre-existing software (bottom-up)
What are the advantages of Brownfield Engineering?
- Existing code can be reused
- A starting point is provided
- Incremental improvements
- Already defined and documented processes
What are the disadvantages of Brownfield Engineering?
- Legacy code can bring problems
- Detailed understanding of existing systems is required
- Some pieces of existing systems may need a redesign
What are the advantages of Greenfield Engineering?
- Possible to use the best technologies available
- No legacy constraints or dependencies
What are the disadvantages of Greenfield Engineering?
- Risk is higher due to the lack of clear direction
- More time needed
- Difficult to make critical decisions
Not-Invented-Here Syndrome
Tendency to avoid using software you did not create yourself because you have too much pride
What are the common fundamental software patterns?
- Big Ball of Mud
- Unitary Architecture
- Client/Server
Big Ball of Mud
Absence of any visible architecture structure
What are the problems associated with Big Ball of Mud?
The lack of structure makes change very difficult. Problems with:
- Maintainability
- Deployment
- Testability
- Scalability
- Performance
Unitary Architecture
Includes:
- Applications working on a single PC
- Mainframe systems
- Embedded systems
- Highly constrained environments
What are the different types of client/server architectures?
- Desktop + database server
- Browser + web server
- Three-tier
Layered Architecture
Separates codebase into different layers which group together modules and components with similar functionalities. Each layer has a specific role within the application.
What are the 4 layers discussed in this course?
- Presentation Layer
- Business Layer
- Persistence Layer
- Database Layer
What is the benefit of closing layers in layered architecture?
Changes made in one layer don’t impact or affect components in other layers. This allows for better coupling.
Architecture Sinkhole
An anti-pattern that occurs when all layers in a codebase using layered architecture are closed. The result is that requests move from layer to layer as simple pass-through processing. There is no business logic performed within each layer (functions are made exclusively to pass data from layer to layer)
REST Rules
- Use HTTP methods explicitly (e.g. GET, POST, PUT, DELETE)
- Return correct status codes
- Be stateless
- Have clear URIs
- Support multiple data-exchange representations
Status code 2xx
Request processed successfully
Status code 3xx
Redirection (“Go away”)
Status code 4xx
Client error (“You did something wrong”)
Status code 5xx
Server error (“I did something wrong”)
Stateless REST
Every HTTP request happens in complete isolation. When the client makes an HTTP request, it includes all information necessary for the server to fulfill that request. The server should not track the client’s state
REST URI rules
- Use 2 URIs per resource (e.g. /reports, /reports/4)
- Use plural nouns
- Don’t use verbs
- Use lower case
- Use hyphens, not underscores
- Avoid file extensions
GET Method
Requests a representation of a specified resource (retrieves data)