Note
0.0
(0)
Rate it
Take a practice test
Chat with Kai
undefined Flashcards
0 Cards
0.0
(0)
Explore Top Notes
Unit 2: All Words
Note
Studied by 89 people
5.0
(2)
Population Growth and Resource Availability (3.5)
Note
Studied by 21 people
4.0
(1)
ACT Math Test
Note
Studied by 76 people
4.0
(1)
Toxteth, Liverpool - CASE STUDY
Note
Studied by 1 person
5.0
(1)
5 to 5 AP Government Chapter 8: Political Culture
Note
Studied by 37 people
4.0
(1)
AP World History - Ultimate Guide
Note
Studied by 172 people
5.0
(1)
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
Unit 2: All Words
Note
Studied by 89 people
5.0
(2)
Population Growth and Resource Availability (3.5)
Note
Studied by 21 people
4.0
(1)
ACT Math Test
Note
Studied by 76 people
4.0
(1)
Toxteth, Liverpool - CASE STUDY
Note
Studied by 1 person
5.0
(1)
5 to 5 AP Government Chapter 8: Political Culture
Note
Studied by 37 people
4.0
(1)
AP World History - Ultimate Guide
Note
Studied by 172 people
5.0
(1)