Conceptual Flashcards
Test Driven Development
- Add test
- Run test and fail
- Implement new functionality
- Test should now pass
- Refactor
Single Responsibility Principle
Each thing should only do one thing
Interface Segregation Principle
states that no code should be forced to depend on methods it does not use
ie split your methods down so you can customize what’s relevant
Singleton pattern
software design pattern that restricts the instantiation of a class to a singular instance
Wrapper class what is it
A wrapper object stores a single value of the corresponding type
Wrapper class why
useful to store primitives in various data
structures like Sets
and
useful static conversion methods
How many parent classes can a child class have?
1
child classes methods
unique or can modify parent methods
abstract class and instance variables
maybe
abstract class and constants
yeah
Abstract class and abstract method
yes but no body
-there is common data (instance variables), and/or
-some functionality can be defined, and
-some functionality depends on child class
abstract class
-you are just specifying that certain behavior (i.e., methods) must exist
-no instance variables are allowed
-constants are allowed – why?
Use an interface
enum type
type whose fields consist of a fixed set of
constants
Array benefits
*Fixed size
*More efficient if large number of primitives (e.g., int)