Object Oriented Programming (DIEF, UNIMORE)
Software
Tutorials, exercises
- IntelliJ Tutorial
- Java SE Tutorial
- Java SE API
- https://www.w3resource.com/
- https://www.baeldung.com/
- https://codingbat.com/java/
- https://www.programiz.com/
- https://exercism.io/
GitHub
Books
- Big Java - Early Objects; Horstmann; Wiley Press (intermediate) Book resources
- Effective Java; Bloch; O'Reilly (advanced)
Videos
Project
Home projects have to follow these guidelines:
- Stored on a GitHub repository (complete with README.md and LICENCE files)
- Respect Java Coding Standard (see books/)
- 1000-2000 lines of logic code, excluding GUI/XML files
- Refer to this project as a well-made example
Exam
During the final exam students are expected:
- to solve exercises (including unit tests) from com.nbicocchi.exercises (1 or 2) (60% weight)
- to answer general questions about the key topics of the course (1 or 2) (20% weight)
- to discuss the structure and engineering choices of the home project (20% weight)
Java Modules
[M1] From Functions to Objects
- Evolution of programming languages
- Limits of procedural programming
- Modularization, reuse of code, and object-oriented programming
- Object-oriented programming key features
[M2] Basics
Read: Big Java (Chapter 4-5-6), Java Coding Standard
Lab: package com.nbicocchi.exercises.arrays/strings
- Types, variables, constants
- Methods and parameter passing
- Flow control
- Loops
- Strings
- Arrays
- Terminal I/O
- Coding Standard
[M3] Object Oriented Programming
Read: Big Java (Chapter 2-3-8-9-10)
Lab: package com.nbicocchi.exercises.oop
- Classes, objects, packages
- Attributes, methods, visibility
- Constructors, getters/setters, toString()
- Inheritance, upcasting, downcasting
- Polymorphism, method overloading/overriding
- Abstract methods, abstract classes, interfaces
- Wrapper types
- UML class diagrams
[M4] Data Structures (Collections Framework)
Read: Big Java (Chapter 15)
Lab: package com.nbicocchi.exercises.collections
- Collection (Set, Queue, List) interface and its implementations
- Map interface and its implementations
- Iterator and ListIterator (definition and use)
- Sorting and searching
[M5] Generic Data Structures (Generics)
Read: Big Java (Chapter 18)
Lab: package com.nbicocchi.exercises.generics
- Array sub-typing
- Object sub-typing
- Collection sub-typing
- Bounded wildcards types
[M6] Functional Interfaces
Read: Big Java (Chapter 19), Object Oriented vs Functional Programming (Chapter 1)
Lab: package com.nbicocchi.exercises.functional
- Anonymous classes
- Lambda expressions
- Functional interfaces
- Streams
[M7] Exceptions
Read: Big Java (Chapter 11)
Lab: package com.nbicocchi.exercises.exceptions
- Exceptions (checked and unchecked) and Errors
- Catching Exceptions (try/catch/finally)
- Throwing Exceptions (throw)
- Delegation models (complete, partial, no delegation) (throws)
[M8] JavaFX Framework
Read: Introduction to Programming Using Java (Chapter 6-13), Watch: JavaFX GUI Full Course
- Structure of JavaFX (key interfaces)
- Layout management
- Event delegation model
- Basics of game development
[M9] Multi-threading
Read: Big Java (Chapter 22)
- Thread states
- Race conditions
- Basic synchronisation (synchronised/sleep/yield/join)
- Advanced synchronisation (wait/notify)
[M10] Data Access (JDBC)
Read: Big Java (Chapter 24)
- Database connection architecture
- Connection, Statement and Resultset classes
- Connection Pools
- Scrollable, Updateable Resultsets
[M11] Data Access (REST)
- Motivations and basic concepts
- Resources, Operations, Representations (JSON, XML)
- GET/POST/PUT/DELETE requests
- Design of a client/server staleless application
[M12] Data Access (I/O Framework)
Read: Big Java (Chapter 21)
- InputStream/OutputStream interfaces (binary files)
- Reader/Writer interfaces (text files)
- Tokenizers (Scanner/StringTokeniser classes)
- Filesystem manipulation (File/Files classes)
FAQ
Should I carefully read and understand this FAQ?
Yes!
Developing a project at home is the goal of the course?
No! The goal is not developing a home project! The goal of the course is learning how to code in Java and Python. Developing a project is only a (hopefully fun) way to do com.
Can we develop the project in groups of 1 or 3 people?
No, groups must be composed of 2 people. There are no exceptions. The use of Github for sharing code is mandatory. People unable to find a teammate should post a message on Teams (Ricerca compagni channel). Groups should be composed of teammates with comparable coding skills. Exceptions to this rule will be negatively evaluated.
Can we use JavaScript, TypeScript, Kotlin, Dart, Swift, C++, C#?
No! Only Java and Python are allowed. If you learn properly Java and Python, you will be able to switch to any modern object-oriented language pretty quickly.
Which kind of project can we do?
You can code a video game, a managing software, an Android app. See examples in the repository as a reference.
Which IDE should I use for developing an Android app?
Android Studio is perfect. It is a version of IntelliJ specifically tuned for Android development.
Can we use external libraries?
Sure! The object oriented paradigm has been initially proposed for promoting the reuse of code and building larger projects! For example, for developing games LibGDX, Slick2D, or Tiled are useful. Conversely, for a managing software you can use JavaFX, or Spring.
Can we use a GUI designer?
Yes, of course!
How big the project has to be?
A project of 1000-2000 lines of code (excluding GUI/XML if present) is enough to get the feeling of what developing software means. Projects bigger than 5000 lines (excluding GUI XML if present) are not advised.
What is the best moment for starting the project?
The first half of the course concerns basic topics that must be assimilated before starting. My personal suggestion is to start the project around midterm and use the second part of the course to sketch out the main design.
While developing I get strange errors. What should I do?
The first thing to do is copy and paste the error string on Google and check for eventual answers on StackOverflow. The vast majority of common errors has a dedicated page.