Mindmap
Designing Classes
Inhalt der Mindmap
Designing Classes
Encapsulation: Allows for a programmer to hide a variable hidden using the private field. To get the value, the programmer can create an accessor method
Cohesion/Coupling
- Cohesion: All interface features are closely related to the single concept that the class represents.
- Coupling: When many classes of a program depend on each other. It is important to keep a check to make sure that coupling is not too low or too high.
Variables
- Instance variables: variables that are private to the class, requires an accessor method to get it.
- Variable scope: It is the scope of where and how much a variable can be accessed from. You want to minimize who gets access by thinking about who would really need it.
- Static variables: Used to set the variable a certain value that is set throughout the whole class. You use the static field.
Methods
- Accessor: Returns a value
- Mutator: changes the program.
- Immutable objects: objects that are not able to be changed.
- Side effect: This is anything that modifies another object, this includes console outputs.
- Pre-conditions: parameters.
- Post-conditions: things that the method returns/modifies.
- Constructor: sets the values to the instance variables and takes in parameters. It is called as soon as you use the class to make an object.
- Passing parameters
- Implicit parameter: name of the object or class
- Explicit parameter: values you are giving to the method.
Accessor Modifiers: Both return a value and also mutate the program.
Packages: A set of related classes. For example, the java library consists of several hundred packages.
Informationen
- Beschreibung
- Mindmap am Designing Classes, erstellt von John Hair am 30/04/2018.
- Erstellt von
- John Hair
- Aufrufe
- 0
- Bewertung