GoConqr has a new look! Let us know what you think.

Mind map

Designing Classes

John Hair English

Map content

Designing Classes

  1. 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

  2. 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.
  3. 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.
  4. 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.
  5. Accessor Modifiers: Both return a value and also mutate the program.

  6. Packages: A set of related classes. For example, the java library consists of several hundred packages.

Information

Description
Mind Map on Designing Classes, created by John Hair on 30/04/2018.
Created by
John Hair
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?