Terminology Flashcards

1
Q

Class

A
  • Class is a blueprint /template to describe object.
  • Class describe characteristic, and behavior of object allow representation of the real-world object in coding and improve the readability of code
  • Class is one way of Java implement type or class is a type. The values of the type are the object and the methods of the class operate on the object
  • Class always contains unique characteristics to particular object and normally with different value.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Object

A
  • Object is normally referring to an abstraction of real-world entity and is has attributed and behavior.
  • Object is an instance of class that have state or values that represent a instantiation of the class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Constructor

A

A special method will be call when constructing the object to initialize the object state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Attribute

A

Attribute is referring to the characteristic or property of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Method

A
  • Method encapsulate a set of instructions that are related to achieve a single task or goal.
  • Method is a collection of statements that group together to achieve a goal or perform a task.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Parameter

A

A parameter is a special kind of variable, used in a subroutine/procedure to refer to one of the pieces of data provided as input to the subroutine/procedure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Argument

A

The arguments are the values supplied to the subroutine/procedure when it is called.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Behaviour

A

Behaviour is about task and actions can be performed by the object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Characteristic

A

Characteristic is the property, quality, or state of the object that described using values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Variable

A

Variable is an identifier in the program that store a value/reference that could be change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Constant variable

A

Variable where its value cannot be change once being assign.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Instance variable

A
  • Variable declare as the property of a class that represents the state of an object.
  • Instance variable is belong to particular instance object that represent the state of the object.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Instance method

A

Instance method is the subroutine of an object, declared in a class.

  • Belong to instance object.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Static variable/ Class variable

A

Variable declare as property of class that shared among instances of the class and have only one copy throughout the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Predefined library

A

The predefined libraries contain classes, methods that are pre-written by respective programmers to provide common solutions to problem face in application development. It has higher quality and access by everyone.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

User defined library

A

User defined library is maintained by individuals or company to solve specify problem domain. the quality depends on the programmer and used privately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Type

A

Type is a set of data values and the operations that can be performed on them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Inheritance

A
  • Inheritance allow generalization and specialization to eliminate code redundancy and improve coding maintenance.
  • Inheritance is a technique to allows a class to contain some features from the other class without replication to encourage code reuse. Or it refers to the ability of one class (child class) to inherit/obtain the identical functionality of another class (super class), and then add new functionality of its own.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Generalization

A

Generalization is the process of avoiding code and data duplication among several classes by creating a super class to those classes and moving the duplicate code and data up into that superclass, which is commonly abstract. The code is going upward in the class hierachy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Specialization

A

Specialization is the process of extending an existing class by adding new features is called using inheritance for specialization. The code is moving downward in the class hierarchy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Inheritance for specialization

A

The process of extending an existing class by adding new features is called using inheritance for specialization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Singleton Object

A

An object that has only one instance in the entire program and it is defined using object keyword.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Companion Object

A

It is a singleton object that has the same name with a class name, and it is use to describe every instance of the class. It always contains common characteristic for all instances of the class with same values.

24
Q

Signatures

A

A method signature is part of the method declaration. It is the combination of the method name and the parameter list.

25
Q

Overloading

A

Overloading is to allows declaration of method to have the same name/identifier but difference signatures.

26
Q

Overriding

A
  • Overriding is to modified the implementation of a concrete method with the same name/identifier and signatures.
  • Overriding concrete methods means that the method implemented in the parent class is hidden away and replace with overridden method in the sub class
  • Overriding abstract methods means provide implementation of the unimplemented in the parent class.
27
Q

Abstract class

A
  • Class that may has unimplemented methods and could not create instances, It allows defining a class that is too abstract to have implementation.
  • Abstract is about class that may contain unimplemented methods or variable that need to be further defined by class that extends.
28
Q

Concrete class

A

Concrete class is a class that can create instances object. It contains only implemented methods and property values. It is normal class that represents real world entity in term of characteristic and behaviour.

29
Q

Polymorphism

A
  • Polymorphism is the characteristic of being able to assign a different meaning or usage to something in different contexts.
  • Polymorphism allow the same operation/message to be carried out on different objects and perform differently.
30
Q

Parametric polymorphism

A
  • Parametric polymorphism allows a function or a data type to be written generically, so that it can handle values identically without depending on their type.
  • Allows a class/trait/functions to accept data type as a value so that class/trait/functions can be written generally.
31
Q

Subtype polymorphism

A
  • Object of subtype can be legally used wherever and object of a supertype is expected is called subtype polymorphism.
  • Polymorphism in one of the OOP features that allow the program to be extensible and maintainable/
  • allow Object of a subtype can be legally used wherever an object of a supertype is expected. It employ the idea of subtyping to restrict the range of types that can be used in a particular case of polymorphism.

val vehicle1: Vehicle = new Car()

32
Q

Cohesion

A

Cohesion is a measure of how focused the responsibility of a module are.

33
Q

Coupling

A

Coupling refers to how dependent modules are on each other.

34
Q

Interface

A

Interface is a second way of Java implement type. The values of the type are object of Class that implement the interface and the methods of the interface implemented by Class operate on the object.

Interface is a special class that specify the similar behavior among difference type of classes without implementation.

Interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class)

35
Q

Trait

A

Traits are used to share interfaces and fields between classes. They are similar to Java 8’s interfaces with addition it can contain concrete variable and methods. Classes and objects can extend traits cannot be instantiated and therefore have no parameters.

  • Trait is a partial/part description of an objects. Where the description can be incorporated in different class.
36
Q

Generic programming

A

Generic programming allow types to be parameterise in class, interface or methods much like formal parameter use in method declaration.

37
Q

Iterator

A

Iterator is an interface for collection in Java/Scala library that specify hasNext and next abstract function

38
Q

Data field

A

Data field represent the attribute of an object.

39
Q

Property

A

property is a method in OOP to expose private data field through getter and setter so that data can be encapsulated in within the class to hide internal data field handling and also allow implementation of data validation.

40
Q

Companion object

A

Companion object is the singleton object that has the same name with the class and is written in the same source of together with the class.

41
Q

Singleton object

A

Singleton object is object that has only 1 instance in the entire program.

42
Q

Mixin

A

A mixin is a class that cantains implementations for use by other classes without having to be the parent class of those other classes. How those other classes gain access to be the mixin’s methods depends on the language. Mixins are sometimes described as being “included” rather than “inherited”.

43
Q

Instantiation

A

Instantiation is creation of object from a class.

44
Q

Initialization

A

Initialization is assigning values to object’s attributes

45
Q

Association

A

When object has any relationship(has a, is a assigned…) to another object.

46
Q

Aggregation

A

An association indicates that one class is part of another class. In an aggregation relationship, the being referenced class instance can outlive its belonging class.

47
Q

Composition

A
  • An association indicated that one class is a part of another class.
  • A strict form of aggregation where the life of the part is tied to the life of the whole.
48
Q

Identifier

A

Identifier is the naming given to variable, method or class. It usually follow a set of rules depend on the programming language.

49
Q

Has-A relationship

A

When an object of one class maintain a reference to objects of another class then it can be consider the object has another object.

50
Q

Is-A relationship

A

When a set of object of Class A is a subset of object of Class B then it is consider A has is-a relationship with B.

51
Q

Guideline of identify class

A
  • Extract Nouns and Verbs
    • > Based on the problem specification, identify the nouns and verbs used in describing the problem.
  • Use concepts from the application domain
    • > From the background of the problem domain, find extra class candidate
  • Use CRC Cards
    • > A small size note card (4” x 6”) that allow you to summarize the responsibilities of each class in a few words and helps the design team avoid getting bogged down in low-level detail too soon.
52
Q

Guideline of creating class

A
  • Every class should be responsible for doing one things only and doing it well.
  • Different kinds of responsibilities should be separated among different objects.
  • The object that contains the necessary data to perform a task should be the object that performs the task. (expert pattern)
  • Avoid duplication. Dry principle = don’t repeat yourself.
  • Only one class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.
  • Class should have complete and consistent protocols.
  • Class should design for changes by following Open-Closed Principle that is design software to be open for extension but closed for modification.
  • Obey the law of Demeter.
53
Q

Guideline of object oriented development by Ralph Morelli & Ralph Walde

A
  • Problem Specification
  • Problem decomposition
  • Design Specification
  • Data, method, and Algorithm
  • Coding
  • Testing, debugging
54
Q

Scala linearization

A

Scala linearization is a deterministic process that puts all traits in a linear inheritance hierachy

55
Q

The rules for process of linearization

A

1) Start at the first extended class or trait and write that complete hierarchy down. We will call this the linearized hierarchy

2) Take the next trait and write this hierarchy down
- now remove all classes/traits from this hierarchy which are already in the linearized hierarchy
- add the remaining traits to the bottom of the linearized hierarchy to create the new linearized hierarchy.

3) Repeat step 2 for every trait.
4) Place the class itself as the last type extending the linearized hierarchy