Note
0.0
(0)
Rate it
Take a practice test
Chat with Kai
undefined Flashcards
0 Cards
0.0
(0)
Explore Top Notes
Rights and protest (IB)
Note
Studied by 484 people
5.0
(1)
Early Humans
Note
Studied by 46 people
5.0
(2)
Girl With A Dragon Tattoo (Entire book)
Note
Studied by 42 people
4.5
(2)
Ultimate AP Seminar Study Guide
Note
Studied by 7901 people
4.9
(10)
Chemistry HL 3.2 Periodic Trends
Note
Studied by 87 people
5.0
(1)
DBQ/LEQ Contextualization Ideas & Tips (AP World History)
Note
Studied by 432 people
4.8
(5)
Home
Java Programming - Object-Oriented Design
Java Programming - Object-Oriented Design
Object-Oriented Design
Method Design
High-level design issues:
Identifying primary classes and objects.
Assigning responsibilities.
Low-level issue: Design of methods for efficiency and elegance.
Method Decomposition
Methods should be small and understandable.
Large methods can be decomposed into smaller methods for clarity.
Example: Translating English to Pig Latin involves multiple decompositions:
Translating each word.
Handling words by categories (e.g., starting with vowels, consonants, blends).
Visibility in UML Class Diagrams
Public members: +
Private members: -
Example: Pig Latin
Implementation shows method decomposition in action.
Involves main method for reading input and translating sentences.
Objects as Parameters
Java passes parameters by value (copies).
When objects are passed, the actual and formal parameters are aliases.
Method Overloading
Single method name can have multiple definitions based on parameters.
Signature must be unique (number, type, order of parameters) to determine the method invoked.
Examples:
println(String s)
,
println(int i)
.
Testing
Various definitions: executing programs, human evaluations, finding errors.
Reviews enhance design or code quality via outside perspectives.
Test cases involve sets of inputs with expected results; organized into suites.
Types of testing:
Defect Testing
: Executing to find errors.
Black-Box Testing
: Based on inputs and expected outputs without logic consideration.
White-Box Testing
: Focuses on internal code structure to test all paths.
Conclusion
Effective design involves method decomposition, parameter handling, and thoughtful testing strategies for quality assurance.
Note
0.0
(0)
Rate it
Take a practice test
Chat with Kai
undefined Flashcards
0 Cards
0.0
(0)
Explore Top Notes
Rights and protest (IB)
Note
Studied by 484 people
5.0
(1)
Early Humans
Note
Studied by 46 people
5.0
(2)
Girl With A Dragon Tattoo (Entire book)
Note
Studied by 42 people
4.5
(2)
Ultimate AP Seminar Study Guide
Note
Studied by 7901 people
4.9
(10)
Chemistry HL 3.2 Periodic Trends
Note
Studied by 87 people
5.0
(1)
DBQ/LEQ Contextualization Ideas & Tips (AP World History)
Note
Studied by 432 people
4.8
(5)