Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
course-material
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IT1901
course-material
Commits
497d180b
Commit
497d180b
authored
1 year ago
by
George Adrian Stoica
Browse files
Options
Downloads
Patches
Plain Diff
edit: update slides for the lecture 11
parent
97be354e
No related branches found
No related tags found
No related merge requests found
Pipeline
#291423
failed
9 months ago
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/revealjs/11-solid-uml.adoc
+82
-4
82 additions, 4 deletions
lectures/revealjs/11-solid-uml.adoc
with
82 additions
and
4 deletions
lectures/revealjs/11-
lecture-
solid-uml.adoc
→
lectures/revealjs/11-solid-uml.adoc
+
82
−
4
View file @
497d180b
...
@@ -8,8 +8,7 @@
...
@@ -8,8 +8,7 @@
include::{includedir}header.adoc[]
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
[.smaller-80][.center-paragraph]
IT1901 Fall 2022 - {LECTURE_NO}
IT1901 Fall 2023 - {LECTURE_NO}
[.smaller-30]
[.smaller-30]
...
@@ -17,8 +16,11 @@ Partially based on slides from Torgeir Dingsøyr and Hallvard Trætteberg
...
@@ -17,8 +16,11 @@ Partially based on slides from Torgeir Dingsøyr and Hallvard Trætteberg
== Overview
== Overview
- OOD - SOLID, DRY
- OOD - SOLID, DRY
- Some useful considerations
- UML Diagrams
- UML Diagrams
- Summary
[background-color = "#124990"]
[background-color = "#124990"]
[color = "#fff6d5"]
[color = "#fff6d5"]
...
@@ -37,12 +39,41 @@ designing object classes and the relationships between these classes.”
...
@@ -37,12 +39,41 @@ designing object classes and the relationships between these classes.”
== Object Oriented Principles
== Object Oriented Principles
- Encapsulation
- Abstraction
- Abstraction
- Encapsulation
- Inheritance
- Inheritance
- Polymorphism
- Polymorphism
== Abstraction
- hiding the internal data and implementation from the external world
- hide complexity and show essential information
- could be classified further
** data abstraction
** process abstraction
- abstract classes and interfaces
== Encapsulation
- integrating fields (data) and methods (behaviors) into a single unit
- fields are hidden from other classes
- fields can only be accessed by the methods of the class in which they are found
== Inheritance
- mechanism that allows classes to acquire fields and behaviors from other class
- the properties of the "parent" class are inherited by the "child" class
== Polymorphism
- the ability to perform a single action in different ways
- differently stated - have one interface but have multiple implementations
** overriding
** overloading
== Common issues OOD
== Common issues OOD
- External dependencies:
- External dependencies:
...
@@ -161,10 +192,56 @@ https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
...
@@ -161,10 +192,56 @@ https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[background-color = "#124990"]
[color = "#fff6d5"]
== Some useful considerations
== Refactoring
- work on the code without adding functionality
- simplify and optimize
- make it more maintainable and reusable
== Refactoring (2)
- find problem areas and improve
** very long classes or methods
** long list of parameters
** confusing package structures
** ...
== Refactoring (3)
- aim for short methods with simple control flow
- avoid recursion (harder to understand the )
- limit loops
- limit variables to the smallest scope possible
== Nesting
- complex flow in methods is hard to understand
- if you are beyond 2-3 levels you need to consider refactoring
== Naming
- use suggestive names
- adhere to conventions
- do not abbreviate
- avoid single letter variables (y)
- do not include types in names (intCount, bResult)
== Naming (2)
- do include units where needed ( delayInSeconds )
- difficulty naming might indicate the need to rethink design
- avoid naming classes Abstract... or Base...
- avoid using an evergrowing "Utils" class
[background-color = "#124990"]
[background-color = "#124990"]
[color = "#fff6d5"]
[color = "#fff6d5"]
== UML
== UML
Diagrams
[.smaller-80]
[.smaller-80]
== UML - Unified Modelling Language
== UML - Unified Modelling Language
...
@@ -281,6 +358,7 @@ TodoListListener -> TodoController: updateTodoListView
...
@@ -281,6 +358,7 @@ TodoListListener -> TodoController: updateTodoListView
```
```
[background-color = "#124990"]
[background-color = "#124990"]
[color = "#fff6d5"]
[color = "#fff6d5"]
== Summary
== Summary
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment