DMS Flashcards

1
Q

What is Polymorphism? Explain both methods

A

Polymorphism in Java means that a single interface or method can handle different types and behaviors.

Compile Time - Method overloading occurs when a class has multiple methods with the same name but different parameters.

Run Time - Method overriding, on the other hand, happens when a subclass provides a specific implementation for a method that is already defined in its superclass.

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

What is encapsulation?

A

protect some components from external access
integrating data and code into a single unit.

Just using getters and setters (like the model in MVC).

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

What are the advantages of using UML diagrams?

A

Enhances Communication and ensures the right communication.
Helps to manage complexity.

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

What are all the symbol in a class diagram?

A

+ = public
- = private
# = protected
/ = derived
$ = static

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

What is association relationship?

A

Reference based relationship between two classes
Class A holds a class level reference to class B

ex : Class Player and Class Asset. Inside class Player -> private Asset asset public player (Asset purchasedAsset)
{

}

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

What is dependency relationship?

A

Created when you receive a reference to a class as part of a
particular method

Dependency indicates that you may invoke one of the APIs of the
received class reference and any modification to that class may
break your class as well

example -> Class Die and class Player. Inside class player -> public void takeTurn (Die die)
{
die.roll();
}

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

Difference between dependency and association

A

Dependency usually invoke one of the APIs of the received class reference, whereas association doesn’t?

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

What is aggregation Relationship?

A

Very similar to association, aggregation Container and The Part just means (“has-a”) Aggregation is about creating relationships between classes where one class (the container) holds instances of another class (the part).
aggregate can be shared with others

ex : Class Player and Class Asset. Inside class Player -> private List assets
public void addAsset (Asset purchasedAsset)
{
assets.add(purchasedAsset);
}

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

What is composition relationship?

A

Relates to instance creational responsibility

Example, Class Piece and Class Player -> Inside Class Player {
private Piece piece = new Piece();
}

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

What is a realisation relationship?

A

two sets of model elements, one representing a specification (the
supplier) and the other representing an implementation (the client)
of the specification

e.g -> class SearchService implements SiteSearch

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

What is a generalisation relationship?

A

A directed relationship between a more general classifier
(superclass) and a more specific classifier (subclass)

e.g - >
class LecturerInformation extends UserInformation
class StudentInformation extends UserInformation

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

What are sequence diagrams used for?

A

A sequence diagram is used to illustrate how objects interact with each other within a system in a specific sequence over time.

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

What are the state machine diagrams used for?

A

Show the possible states of a single object, the events or
messages that cause a transition from one state to another,
and the action that result from that state change

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

What are activity diagrams used for?

A

Graphical representations of workflows of stepwise activities

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

What are all the design patterns and what they are used for

A

Factory Method, Observer, Singleton, MVC, Abstract Factory-, Adapter.

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

What are the five characteristics of maintainable software?

A
  1. Modularity- software organised into modular components or modules, each responsible for a specific functionality or feature
  2. Reusability -
  3. Analysability -
  4. Modifiability -
  5. Testability -
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the 3 categories of maintainance?

A
  1. Corrective : Finding/Fixing errors
  2. Adaptive : adapting system to environment
  3. Perfective & Preventative : increase quality and prevent future bugs from occurring.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is regression testing?

A

A type of software testing to confirm that a recent change has not affected existing features

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

What are the four ideas OOP is founded on?

A
  1. Abstraction: objects represent complex underlying code
  2. Encapsulation: protect some components from external access
  3. Inheritance: subclass extend/override functionality of superclass
  4. Polymorphism: provision of a single interface to entities of different types
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is to use ‘this’ keyword

A

when a method is used or when you access a variable inside an object, the term “this” is like a special word that refers to that specific object.

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

What is a collection?

A

an object that represents a group of objects.

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

What is the JCF?

A

Java Collections FrameWork
- contains data structures : arrays, lists, maps, etc..
- contains algorithms operations : sorting , searching, etc..

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

What’s the difference between aggregation and composition?

A

Aggregation - “is-a” relation where one class contains another as a part, but the part can exist independently.

Composition - stronger “has-a” relation where the part cannot exist without the whole.

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

What is inheritance?

A

Forming new classes based on existing ones
SuperClass and SubClass

25
Q

Differentiate between abstract classes and concrete classes

A

Abstract classes = provide a blueprint for other classes and may have abstract methods, can’t be instantiated has to be extended.

Concrete classes = are complete and can be instantiated directly.

26
Q

Differentiate between interfaces and abstract classes

A

Abstract classes: can have both abstract and non-abstract methods; can have fields, constructors.

Interfaces: can only have abstract methods; can only declare method signatures
- classes can implement multiple interfaces, but can inherit from only one abstract class

27
Q

What is the aim of refactoring?

A

Improve code quality
Enhanced readability
Maintainability

28
Q

Examples Of Build tools

A

Maven and Gradle

29
Q

Why use build tools?

A

Project Compilation
Dependencies
Allows for better maintenance
Automated testing

30
Q

What is the POM file?

A

Project object model
- Contains configuration about your project, e.g. dependencies, plugins.

31
Q

Why should we use FXML?

A

Whilst the programmers resolve the back end the designers can use external software (Scene builder) to design the UI. Building GUIs visually instead of programatically makes intuitive sense. Can test/fix application logic without touching the GUI design or vice versa.

32
Q

What is the abstract factory design pattern?

A

Create families/factories of related objects without imposing their concrete classes

33
Q

What is the Factory Method design pattern?

A

Provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created.

34
Q

What is the Singleton design pattern?

A

Ensures a class has only one instance and provides a global point of access to that instance.

35
Q

What is the Observer design pattern?

A

an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

36
Q

What is the adapter design pattern?

A

Allows incompatible interfaces between classes to work together without modifying their source code.

37
Q

MVC

A

The communication between each goes like this:
view -> controller , controller -> model, controller & model -> view

38
Q

What does a VCS mean?

A

Version Control System

39
Q

What is an example of a VCS?

A

Git

40
Q

Why use VCS?

A

Track Changes
Recover Old Version
Works Across networks

41
Q

How to deal with concurrency management

A

Lock-Modify-unlock solution
Copy-modify-merge solution

42
Q

What is abstraction?

A

The process of hiding all the non-relevant data about an object in order to reduce complexity and increase efficiency.

43
Q

What is an interface in java?

A

An interface in Java is a collection of abstract methods (methods without a body) and constants.

44
Q

In JavaFX, what can you do to prevent the GUI become unresponsive?

A
  • Heavy computation should be done elsewhere to prevent freezing
  • Package “javafx.concurrent” provides a way for JavaFX to create and communicate with other threads
45
Q

Who is involved in refactoring?

A

Programmers / Developers
Senior Designers
Management
System Architects

46
Q

What is OSS? Open Source Software

A

OSS is (generally) free software that uses any licence approved by the Open Source Initiative
(OSI)

47
Q

What is Free OSS?

A

Software that gives users rights to run, copy, distribute, change and improve it as they see it
without any permission and payments to any external group or person.

48
Q

Why use open source?

A

Higher Quality
Customisable
Improvable
Collaborative developing
Free

49
Q

Why are there software licenses in place?

A

To protect the user as well as their code.

Rules needed to secure certain freedoms e.g. ->
What can be done with the code
Who can change it
Who can distribute it

50
Q

What are common OSS licenses?

A

Permissive: users can produce ‘closed source’ versions and sell the software

CopyLeft : users can do the same as permissive however same rights as the original OSS that modifications were made on have to be applied, e.g. providing source code and allowing modifications.

51
Q

What are the SOLID principles?

A

S ingle responsibility principle
O pen-closed principle
L isko’s substitution principle
I nterface segregation principle
D ependency inversion principle

52
Q

What is the single responsibility principle

A

Means that a class should have one and only responsibility.

53
Q

What is the Open-Closed Principle

A

States that once a class is complete and working correctly it should be open to extension with things such as new components that don’t change the source code but add new behaviours to it. However it should be closed to modifications so the source code can’t be changed.

54
Q

What is the Lisko’s substitution principle

A

objects of a superclass should be able to be replaced with objects of a subclass without affecting the correctness of the program.

55
Q

What is interface segregation principle

A

States that no code should be forced to depend on interfaces it does not use

56
Q

What is the Dependency inversion principle

A

he high-level modules should not depend on the low-level modules. should depend on abstraction and the abstractions should not depend on the details.

57
Q

Why is it important to avoid duplicate code?

A

Minimise the risk of having errors in multiple places.

58
Q

What does it mean to pull up or push down?

A

Pull up : means to move something from the base class to the superclass
Push Down: means move something from the superclass to the base class.

59
Q

What is technical debt?

A

The hidden cost of opting for a quick simplistic solution in software development.