Test 1 Flashcards
comes into play as the standard notation used in industry for software documentation.
The Unified Modeling Language (UML)
These days, new software is usually:
object- oriented
the software is written using an abstraction called an:
object
Programming using binary numbers:
Machine code
Programming using alphanumeric symbols, or mnemonics, as short hand for machine code:
Assembly language
Assembly language is translated into machine code by a program called an:
assembler
Programming using languages (such as Fortran and COBOL) that have high- level constructs such as types, functions, loops and branches:
High-level languages
High-level languages ( and later generations of programming languages) are translated into machine code using a program called a:
compiler
Programming using cleaner high- level languages (such as Pascal Modula and Ada) that are characterized by fewer pitfalls for the programmer and more discipline in the way a program is broken down into sub-tasks and sub- systems:
Structured programming
Programming using independent modules of data and functions that correspond to concepts in the problem domain, such as Customer or ScrollBar. This modularity leads to even fewer pitfalls for the programmer and encourages the reuse of code across separate programs:
Object-oriented programming
is a description of the steps a development team should go through in order to produce a high-quality system. Also describes what should be produced ( documents diagrams, code, etc.) and what form the products should take (for example, content, icons, coding style)
methodology
Better suited to an object oriented programming style. Included Booch method:
Leading market of methodologies. Owned by IBM
So called ‘agile’ methodology, which means responsive to changes in software requirements or changes in our understanding of the problem
Object oriented methodologies
Rational unified process
Extreme programming
The methodology used in this book, __________ is a simplified one based on widely accepted theory and practice. As a result, you won’t have to learn the complexities of a full industrial methodology. Nor will you be told exactly what to do at each stagewhich will allow you to be more creative as you learn
Ripple
The notation used for illustrations , wherever possible, is the. This has become the accepted standard for software diagrams. presentation conventions mean that some lines are thicker than others and that some characters are in bold or italics. Some of these conventions are difficult to accomplish when drawing by hand:
Unified Modeling Language (UML)
What are some justifications typically given for object orientation?
Objects are easier for people to understand
Specialist can communicate better
Data and processes are not artificially separated
Code can be reused more easily
Object orientation is mature and well proven
Typically, the first rung is fixing faults ( bugs) in the code written by others:
The second rung is writing the code itself:
The third is deciding what code needs to be written:
Finally comes the role of talking to customers to discover what they need and then writing down a specification of what the finished system must be able to do.
programmer
senior programmer
designer
analyst
What is an object?
An object is a thing, an entity, a noun, something you can pick up or kick, anything you can imagine that has its own identity. Some objects are living and some aren’t
All objects have attributes: for example:
Objects also have behavior: for example:
a car has a manufacturer, a model number, a color and a pricea dog has a breed, an age, a color and a favorite toy.
a car can move from one place to another and a dog can bark
each object has certain knowledge , in the form of attributes, and it knows how to perform certain ____________ for the benefit of the rest of the program.
operations
the assignment of human characteristics to inanimate objects or animals. It’s common in object- oriented development , imagining software objects as little people.
anthropomorphism
Before we go any further, it’s important to note that we’re not trying to __________ the real world, that would be far too difficult we’re simply trying to make sure that our software is influenced by real-world concepts, so that it is easier to produce and easier to change.
simulate
is a representation of a problem domain or a proposed solution that allows us to talk, or reason, about the real thing . This allows us to increase our understanding and avoid potential pitfalls:
model
______________ refers to an object hiding its attributes behind its operations (it seals the attributes in a capsule, with operations on the edge)Hidden attributes are said to be _________.
Encapsulation
private
What are some differences between association and aggregation?
Association is a weak form of connection
Aggregation means putting objects together to make bigger objects
Aggregation form a ______________ hierarchy?
Part-whole
Decide which is association or aggregation?
Friends:
Books on a bookshelf:
Windows in an office block:
association
association
aggregation
The connections that you’ve seen on object diagrams until now are called _______. If we want to show that one object knows where the other one is, we can add an arrowhead.
Links
A ________ is a staple value in programming that comprises a sequence of characters
string
Each link can be thought of as an attribute: the label, or _______, indicates the attribute’s name.
role
The arrowhead indicates _______________, knowing where the other object is. Because there’s no arrowhead on the customer end, the implication is that String doesn’t know that it’s associated with aCustomer.
navigability
Navigable links often end up as _____________ in object-oriented programs. (is the address of an object in memory, so that we can find it when we need too)
pointers
Once objects are connected, they can ______________ , to perform more complex tasks than they could on their own.
collaborate
Objects collaborate by sending ____________ to each other
messages
look rather like object diagrams, except that the links have no direction and the object names are not underlined. Officially, there is no way to show replies, so a long-standing convention , the tadpole, has been used instead. Ideally, we would also show sequence numbers, but they’ve been omitted here, because the UML numbering scheme is rather involved
UML communication diagram
Sometimes, we can’t allow things to failwe would be rather disappointed if a fly-by-wire plane crashed because of a software fault. Ensuring success under such circumstances is a specialist area, _____________. Just to give you an idea, here’s one strategy for this is to install three computers on the plane and get them to vote on what to do nextif one computer says fly to the left, but the other two say fly to the right, the plane flies to the right
software reliability
An object-oriented program works by creating objects, connecting them together and getting them to collaborate by sending messages to each other. But who gets the ball rolling? Who creates the first object and who sends the first message? To solve this problem, all object oriented programs have an:
entry point
bad programming practice to allow more and more objects to be created by our program without taking steps to clean them up at the end of their useful life. Traditionally programmers have had to decide for themselves when the last connection to an object was about to be removed so that they could explicitly_______ or ______ the object’s memory
delete
free
( Structured languages don’t have objects , but they do have _______ , _______ and _______ that might need to be freed .) Keeping track of object lifetimes is complicated . It’s very easy for a programmer to forget about some of their unused objects, causing the program to keep growing a fault called a _______________
records
structures
arrays
memory leak
every program has an assistant called a _______________, wandering around, looking for unconnected objects and sweeping them away.
garbage collector
It is common these days for every program to have a ____________ a piece of software that’s always present underneath the code that we write ourselves. It’s this system that performs housekeeping tasks, such as garbage collection.
run-time system
Object- oriented programmers are often heard to say “Every object is an ___________ of a class,” hence the use of this term as a synonym for object.
instance
Some languages allow the programmer to add __________- logical statements that must always be true, such as ‘Objects of this class will always have a positive balance’ or This message will always return a nonempty string. These are useful for reliability, debugging and maintenance
assertions
Because information and services such as those listed above don’t seem to fit well with objects, object-oriented languages usually allow the programmer to put elements onto the class itself. So, as well as ________, ________ and _________
class field
class message
class method
Class elements are not as easy to use as they could be, because some languages don’t treat a class as a pure object inheritance between class elements doesn’t work, for example. Even languages that do treat classes as pure objects run into messy complications with _______________
metaclasses
a class that is guaranteedby careful programming, to have only one instance: the _________. This is a good match for the ‘Is it a leap year?’ case, because there is only one Gregorian calendar
singleton object
most object-oriented languages also have nonobject types called ___________. The reasons given for this impurity usually include brevity performance and ancestry.
primitives
- A small piece of information such as color, height or weight that describes one characteristic of an object
- A named value inside an object
- A piece of code belonging to an object.
- A synonym for operation
- A request sent from one object to another.
- The carrying out of an operation in response to a message.
- A synonym for invocation
- A direct or indirect connection between two objects
- A strong association implying some kind of part-whole hierarchy
- A strong aggregation where the part is inside exactly one whole- the part may also be created and destroyed by the whole
- A set of messages understood by an object
- An agreed way of passing messages over a network
- A collective term for all of an object’s operations
- Attribute
- Field
- Operation
- Method
- Message
- Invocation
- Execution
- Association
- Aggregation
- Composition
- Interface
- Protocol
- Behavior
Related, high quality functions can be grouped into a library, so that they’re available all at once.
Function libraries
An improvement on function libraries, this offer whole classes rather than mere functions . This takes a lots of experience .
Class libraries
is a description of how to create part of an object-oriented system elegantly and effectively. Since their introduction, patterns have also been applied to other areas such as system architectures. Each pattern has a short description, a detailed description, advice on where to use it, and code samples.
Design patterns
as its name suggests, is a pre-existing structure to which you attach your own code. In the object-oriented case, this consists of a number of prewritten classes, along with a document describing the construction rules
Frameworks
represent real-world things, are described by attributes and can carry out behavior (operations, usually called methods).
Software objects
enable objects to communicate and collaborate to accomplish some task
Messages
reclaims the space used by objects when they are no longer needed by the program that created them.
Garbage collection
enable us to group similar objects and share the definition of elements between related objects, so that we don’t have to repeat ourselves.
Classes
results in faster and simpler development, more robust code and easier maintenance .
Reusing code
A collection that keeps all of its objects in the order in which they were inserted.
List
A collection that doesn’t keep its objects in order
Bag
A collection that keeps its objects in order using an implementation of a sequence of objects in which each object points to the next in the sequence.
LinkedList
A collection that keeps its objects in order using an array, a sequence of adjacent memory locations. Arrays have fast access but updating is slow because we may have to shift elements around or create a new array on each update.
ArrayList
An unfinished method is called an _______________, because it’s not realit’s not solid, you can’t kick it.
abstract method
The complement to an abstract method is a ____________ method. This method has real lines of code, it’s solid, you can kick it. In UML, abstract methods are shown in italics and concrete methods are not - where italics are impractical, you can put abstractto the right of the method instead
concrete
An abstract class is a class with at least ________ abstract method - the abstract method may be introduced on the class itself, or it may be inherited from a superclass.
one
What are three reasons to redefine a method?
The inherited method was abstract and we want concrete
The method needs to do some additional work in the subclass
We can provide a better implementation for the subclass
is a strong aggregation where the composed object is inside a single composite the composed object is usually created at the same time as the composite and can be deleted at the same time. In UML, in order to emphasize that this is stronger than aggregation , we use a black diamond instead of a white one
Composition
Inheritance has some unique advantages :
It’s natural
It’s elegant
It allows us to write generic code - for example, code written to work for Fruit will also work for Apple and Pear
However, inheritance suffers from the following problems :
It’s difficult to do well.
It’s difficult to change when you discover deficiencies in your design .
It’s more difficult for client programmers to understand .
The hierarchy leaks’ into client code, making it more difficult to change too.
Composition achieves the same end result as inheritance. However, it has the following advantages:
It’s simpler to produce.
It’s easier to change.
It’s easier for clients to understand.
It doesn’t leak into client code
also called implementation inheritance. This allows one class to inherit from another without the inherited elements becoming part of the new interface.
private inheritance
a class is only allowed to have one parent. works well, which is why languages like Smalltalk and Java have nothing else.
Single inheritance
where each class has any number of parents, is also possible.
multiple inheritance
Advantages of multiple inheritance are that:
It is powerful.
It permits private inheritance.
It is closer to the real world.
It allows mix-in inheritance.
Disadvantages of multiple inheritance are that:
It introduces complexity (for the designer and the client programmer ).
It causes name clashes
It causes repeated inheritance.
It makes compilers more difficult to write.
It makes (fast) run-time systems more difficult to write
occur when elements with the same name, but different implementations are inherited via different routes.
Name clashes
means inheriting the same element from more than one route.
Repeated inheritance
A tool for code sharing and higher level modeling
Inheritence
_________ can be grouped into more general concepts and a class can get (inherit) some of its characteristics from a _________.
Classes
parent class
has at least one method without code; in a concrete class, all the methods contain lines of code
abstract class
the way a business operates:
to specify what our new software system should be able to do:
business requirements modeling
system requirements modeling
Showing relations between Buisness entities:
Shows how Buisness operates:
Domain model
Buisness model
Can provide an illustration of use cases:
Interactions themselves and the order in which they take place:
Communication diagrams
Sequence diagram
A circle standing a long a line represents a Buisness object or _________. It’s it is connected to a vertical bar it represents a ________-
Entity
Boundary
any collaboration that we depict should be the ______________ through the use case.
When we deal with system use cases, we can be more specific about:
normal path
abnormal paths
shows dependencies between (parallel) activities as we move from an initial starting point to a desired goal . They are similar to flow charts or Petri nets, traditionally
activity diagram
black dot indicates the __________ point for the activity
a black dot inside a white circle indicates the ______ of the activity
a diamond represents a _____________ on a departing edge indicates the reason for following that edge;
thick black lines, known as ____________, are used to indicate the beginning and end of a set of concurrent actions
starting
end
decision
forks/joins
___________ system, because we inherited it as part of the existing business.
legacy
an informal description of how a group of use cases fit together:
use case survey
Any actor can _____________ another actor
Specialize
there are three kinds of relationship between use cases themselves: ____________, ___________, and ____________.
specializes, includes and extends.
In order to avoid al sorts of complexity relating to the redefinition of steps and the addition of extra ones, can restrict ourselves to specializing:
abstract use cases
In some cases, an extension is only allowed under certain conditions. We can show this by adding a UML _________ detailing the conditions.
comment
Conditions in UML are expressed as constraints and may be stated in natural language, in pseudocode or in UML’s formal ____________________.
Object Constraint Language (OCL)
Normally, a dashed line with an open-ended arrow in UML indicates a ______________- the source relies on the target in some way.
dependency
Any ________________ (conditions that must be satisfied before the use case is carried out).
Any _______________ (conditions that are guaranteed after successful completion of the use case)
Any _____________ and what to do in each case (although the paths are abnormal, we include them if it’s important for us to specify the system’s reaction ).
Any _____________ that relate to this use case.
preconditions
postconditions
abnormal paths
nonfunctional requirements
One useful scoring technique is traffic lights:
use cases must be implemented in the current increment failure to do so means that the project has failed to reach its minimum goals:
use cases are optional for the current increment and should only be attempted once the green use cases have been completed (they’re added bonuses that we can use to impress our sponsors). Any use case that is incomplete by the delivery date must be dropped completely (partial implementations look unprofessional ):
use cases won’t be implemented in the current increment even if time permitsthey’re outside the scope of the current increment and proper allowances are unlikely to have been made for them:
Green
Amber
Red
________: System requirements, analysis, system design, subsystem design, specification implementation and testing should be complete for use cases in this group.
________: System requirements should be complete and analysis and system design should be complete, or nearly complete, for use cases in this groupsubsystem design, specification implementation and testing are optional.
________: System requirements should be complete for use cases in this groupanalysis is optional; system design should support these use cases ; subsystem design, specification implementation and testing should not be performed
Green
Amber
Red