Exam Flashcards

(81 cards)

1
Q

AOP

A

Aspect-Oriented Programming (AOP) complements OO programming by allowing the developer to dynamically modify the static OO model to deal with cross cutting concerns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Cross-cutting concerns

A

Concerns which “cross-cut” the class structure, lowering cohesion and increasing coupling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CCC Consequences

A

> Code Tangling

> Code Scattering

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Code Tangling

A

1) Code for CC is mixed with the business logic.

2) Reduces cohesion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Code Scattering

A

1) Code is duplicated because it is needed in multiple places
2) Reduces coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Lock handling Problem

A

1) Business logic code (put and get) is mixed with concurrency control code resulting in code tangling and poor cohesion
2) Have to add locking code correctly to every business logic code resulting in code scattering
3) Failure to do so would lead to hard to find bugs
4) Need a single, global lock resulting in extra coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Lock handling Pros

A

1) Avoids code scattering and tangling
2) Lock is localised as a private instance variable
3) Reusable simply by writing a new concrete aspect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

AOP and Design Patterns Pros

A

1) Greater modularisation of concerns
2) Avoid code tangling and scattering
3) Easier software evolution
4) Greater code reuse
5) Easier management (easier to split tasks)
6) Cheaper implementation of new features

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

AOP and Design Patterns Cons

A

1) Program flow is hard to follow
2) Tendency to use CCC everywhere, leading to poor designs
3) Everybody on the team needs to be up to speed with AOP
4) Tools limited to those which support AOP language in use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

AspectJ

A

1) Java AOP framework
2) Classes and aspects are written separately
3) “woven” together at bytecode generation time
4) Nothing in class code referes to the aspects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

AspectJ advice kinds

A

> before - code to be executed before the join point
after - code to be executed after join point
around - replaces the code
pointcut - shows where the CC should be applied

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

AOP and Design Patterns

A

1) Observer and Singleton are the only ones who have any benefits
2) Pure fabrications have no sensible inheritance relationships outside the pattern
3) Combing patters will make AOP solutions more problematic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advice

A

Additional code that you want to apply to your existing model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Join point

A

Place where CCC crosscuts the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Point cut

A

Point of execution in the application at which cross-cutting concern needs to be applied

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Aspect

A

The combination of the point-cut and the advice

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Iterative process

A

> Assumes you can’t get all requirements right at the start.
Progresses in a set of timeboxed iterations
Phases
Disciplines
Artifacts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Timeboxed Iteration

A

Means if you don’t get it done you don’t extend the iteration, you change the plan

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Agile UP Phases

A
  1. Inception
  2. Elaboration
  3. Construction
  4. Transition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

UP Phases [Inception]

A

Initial feasibility study and project go-ahead

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

UP Phases [Elaboration]

A

More detailed study, production of high-risk parts of the system. Iterative except for very small projects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

UP Phases [Construction]

A

The bulk of the work. Iterative.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

UP Phases [Transition]

A

Acceptance testing, “maintenance” etc.; moving on to the next project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Disciplines

A

Done through process, not phases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Disciplines Examples
> Requirements > Domain Modeling > Class Design > Coding
26
Artifacts
> The things you make as part of the process | > The amount of “ceremony” in a project should be appropriate to the scale and nature of the project.
27
Artifacts Agile approach
> Don’t produce more artifacts than you need to | > Don’t make them look pretty unless you have to.
28
Ceremony
Artifacts other than code
29
Use Cases
A description of a set of interactions between a system and and one or more actors
30
Use Cases Formats
> Brief > Casual > Fully dressed
31
Use Case [Brief]
A short paragraph describing the MSS.
32
Use Case [Casual]
The MSS plus short descriptions of the main alternatives
33
Use Case [Fully dressed]
Everything spelt out in full detail
34
MSS
Main success scenario
35
Agile Principles
1. Minimum ceremony – concentrate on producing working code 2. Embrace change (especially in requirements) 3. Constant contact with the customer 4. Self-organising teams rather than hierarchical management 5. Physicality, e.g. use physical cards to record requirements 6. Honesty between developers
36
Agile Manifesto
1. Individuals and interactions over processes and tools 2. Working software over comprehensive documentation 3. Customer collaboration over contract negotiation 4. Responding to change over following a plan
37
Agile Practices
1. Iterative development 2. User stories to capture users’ business needs. 3. Test-driven development 4. Short code-commit-build cycle 5. Programming in pairs 6. Short stand-up meetings 7. Frequent review of team performance
38
User Stories
A short description of something that your customer will do when use software, focused on the value or result they get from doing this thing 1. Written on physical cards, notes on the reverse 2. Customer and developers agree on priorities 3. Broken up into “story points” to generate development tasks (described in developers’ language)
39
GRASP
General Responsibility Assignment Software Patterns | > Basic guidelines/principles for assigning responsibilities to classes – the basic skill of OOD
40
GRASP Patterns
> (Information) Expert | > Creator
41
GRASP Patterns [Expert]
Assign a responsibility to the class that has the information necessary to fulfil the responsibility
42
GRASP Patterns [Creator]
Lists likely candidate classes for creating instances of other classes. (special case of expert)
43
High Cohesion
A class should represent one well-defined entity
44
Low Coupling
A class should not be directly associated with many other classes (but some coupling is necessary).
45
Indirection
> Provides means for a class to use another class indirectly > Ability to reference something using a name, reference, or container instead of the value itself > Used to improve coupling and cohesion (occurs in many GoF patterns).
46
Pure Fabrication
A class which has no counterpart in the domain > Database connectors > Controllers > Underlying data structures
47
Protected variation
Abstract something, so when it varies, it doesn’t affect everything else in a bad way
48
Polymorphism
Ability to process objects differently depending on their data type or class
49
Controller
A pure fabrication placed between the GUI and the internal logic of the system to decouple them
50
Use Case Controller
Controls the actions required in a single use case
51
Façade controller
Represents the whole system, e.g. a hardware device.
52
Singleton
``` > Ensure that only one instance of a class is created > Provide a global access point to the object ```
53
Factory
> Simplified version of Factory Method > Creates objects without exposing the instantiation logic to the client > Refers to the newly created object through a common interface. > Pure Fabrication
54
Factory Method
``` > Defines an interface for creating objects, but lets subclasses decide which class to instantiate > Refers to the newly created object through a common interface ```
55
Abstract Factory
Offers the interface for creating a family of related objects, without explicitly specifying their classes
56
Builder
``` > Defines an instance for creating an object but letting subclasses decide which class to instantiate > Allows a finer control over the construction process ```
57
Prototype
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype
58
Object Pool
Reuses and shares objects that are expensive to create..
59
Chain of Responsibility
> It avoids attaching the sender of a request to its receiver, giving this way other objects the possibility of handling the request too. > The objects become parts of a chain and the request is sent from one object to another across the chain until one of the objects will handle it.
60
Command
> Encapsulate a request in an object > Allows the parameterization of clients with different requests > Allows saving the requests in a queue.
61
Interpreter
> Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language > Map a domain to a language, the language to a grammar, and the grammar to a hierarchical object-oriented design
62
Iterator
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
63
Mediator
> Define an object that encapsulates how a set of objects interact. > Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently
64
Observer
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
65
Strategy
> Define a family of algorithms, encapsulate each one, and make them interchangeable. > Strategy lets the algorithm vary independently from clients that use it
66
Template Method
> Define the skeleton of an algorithm in an operation, deferring some steps to subclasses > Lets subclasses redefine certain steps of an algorithm without letting them change the algorithm's structure
67
Visitor
> Represents an operation to be performed on the elements of an object structure > Lets you define a new operation without changing the classes of the elements on which it operates
68
Null Object
> Provide an object as a surrogate for the lack of an object of a given type. > Provides intelligent do nothing behavior, hiding the details from its collaborators
69
Adapter
``` > Convert the interface of a class into another interface clients expect. > Lets classes work together, that could not otherwise because of incompatible interfaces ```
70
Bridge
> Decouple an abstraction from its implementation so that the two can vary independently > Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy.
71
Composite
> Compose objects into tree structures to represent part-whole hierarchies. > Lets clients treat individual objects and compositions of objects uniformly.
72
Decorator
Add additional responsibilities dynamically to an object.
73
Flyweight
Use sharing to support a large number of objects that have part of their internal state in common where the other part of state can vary.
74
Memento
Capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.
75
Proxy
> Provide a surrogate or placeholder for another object to control access to it
76
Coupling Types
> Internal coupling | > External coupling
77
Internal Coupling
Coupling within a subsystem - the amount of relationships between classes in the system
78
External coupling
Coupling between subsystems
79
Design Pattern
Template best practice solution for a particular situation
80
Why design patterns are important?
1) Encourages best practice 2) Learning tool for new software developers 3) Communication tool between developers, making developing faster and easier
81
Unified Process
An approach to developing business application software using agile techniques and concepts yet still being linear and having somewhat waterfall model timeline.