midterm Flashcards
(42 cards)
Business setting
Software Development is __ __
In order for software companies to survive, development needs to be __
Need ways to avoid ____________________
extremely expensive
predictable
developers building things that are not needed
software delivery phases
____ - what is being built
____ - how it will be built
___ - build it
___ - Verify what is built matches the requirements
analysis
design
development
testing
Software Design creates a plan to build the entire software applications that __ __ __ __, avoid ____and avoid ___ __ _
multiple developers can follow
duplication
wasted development effort
good software design…
Make sure your software _________________
Apply basic __ __ to add ______
Strive for a __________________
does what the customer wants it to do
OO principles to add flexibility
maintainable, reusable design.
UML class notation
A class represent a concept which _____state (attributes) and ________(operations).
Each attribute has a ____.
Each operation has a ____.
The ___ __ name is the only mandatory information
encapsulates
behavior
type
signature
class name
multiplicity
0..1
1
1..1
zero or one (optional)
one and only one (mandatory)
one and only one alternate (mandatory)
multiplicity
0..*
*
1..*
zero or more (optional)
zero or more alternate (optional)
one or more (mandatory)
A superclass includes __ __ __ of the subclass, plus possibly more as well
all the instances
subclass superclass test
__-_
is-a
baker is a employee
A subclass is made up of __ __from another class, the “Parent class” or “superclass.”
selected instances
uml
how to show superclass subclass relation
point white arrow toward superclass
uml
how to show if a field is protected
#
Composition
__ relationship
When you get rid of the __, the __do not exist on their own anymore (in the system you are modelling)
what symbol
example
stronger
whole, parts
black diamond
house (whole), room(part)
Aggregation
__relationship
When the __is destroyed, the __can
still exist
More of “__” than an “owns”
what symbol
example
Weaker
whole, parts
uses
white diamond
team (whole) uses player (part)
why do we not use «includes» and «extends»
They do not help the diagram much if they are right, but if they are wrong it the diagram will not be correct
if b is referenced by classes outside of A (and/or) an instance of b can be referenced by more than 1 instance of A.
Aggregation or composition
aggregation
Encapsulation is where the internal details are ____ from the ___ ___and the user can interact only via a well-defined interface
hidden, end user
What is the interface
The interface of a class
- Anything that a ___ ___ can use
- __-____ methods (that includes constructors)
- ____-____ fields
- The ____ of the class
- ____ ____ are also part of the interface although the objects that can use these are restricted.
- The interface of the ____ class
- Anything that a client object can use
- Non-private methods (that includes constructors)
- Non-private fields
- The name of the class
- Protected methods are also part of the interface although the objects that can use these are
restricted. - The interface of the base class
In Java we use Inheritance to design classes that avoid ___ and are easy to maintain.
It is a separation of concerns, whereby we start with a more _____ class, called the ____ class, and derive a more ____ class
(derived class, subclass or “child class”)
When we extend a class, the derived class inherits all the
____-____ code from the base class and so we have accomplished reuse by design
redundancy
general, base, specialized
non-private
benefits of inheritance
get to expose code to the derived class without making that code public to everyone.
get to reuse code
We can ___ a method from a base class in a derived class to change the implementation of the
method
you must declare a method with the same ____ and ___ ___ in the derived class. This will become the new implementation
(for derived Objects)
override
signature, return type
In your derived class, you can also use ____ to reference a method other than the constructor.
Only necessary when you have ____ the method in the derived class
syntax
super
overridden
super.methodNameFromBaseClass(params);
abstract class
_____ for actual implementations
Definitions not ____
We can use abstract classes to define classes that should only be _____ of other classes.
Abstract classes can have abstract methods that are ___ _____
Placeholders
implementations
superclasses
not implemented
An abstract method contains only a ____.
Subclasses __ ___ these methods
signature
must implement