Module descriptions
* Module description DeVelopment Processes * Module description PRogramming Concepts 2

This site is contains the up to date and combined course material, exercises and announcements about PRC2 (Java Programming 2) and DVP (Development Processes), starting in Februari 2018.

The literature for the courses:

  • For The testing part we use the book Unit Testing with JUnit and Mockito by
    Tomek Kaczanowski.

  • For the PRC2 part we will mainly use the Oracle Java Tutorials on the topic.
    The exercises will be published on this site.

  • For the Development process theory, the literature will be announced here as soon as it has been decided/

Study the theory/ tutorials before you come to class. This will make the lessons most effective, because the questions that you might have from studying could be answered immediately.

Studying is not glancing over some (web) pages, but experiment with the compiler, IDE and other tools, to see if you can use the presented ideas and apply it in your own code.

In the schedule the DVP block is planned before the PRC2 block, thereby promoting the idea of Test Driven Development: You write your test, derived from the requirements and then write your code. To do this properly, you MUST study the PRC2 theory and tasks before you come to the DVP lab sessions.

Topics 2018

Week PRC2 Theory PRC2 Practical DVP1 Theory DVP1 Practical

01

Collection Framework, Comparator

Quiz Inheritance/Polymorphism, Implementation of Stack & Comparator

Unit Testing Introduction, Build Processes and Tools, Subversion (Colloquium)

Test Stack & Comparator, Test Fraction

02

Exceptions & Logging

Beer Assignment

Coverage & Tooling, Test of Exceptions

Test Beer Assignment + Coverage

03

Enums & Generics

Planets for Enums, Shape for Generics

Basics of Project Management, Scope Management

Refactoring Stack, Test Enums, Test Shape

04

Lambda Expressions/Filter, Comparator as Function

Olifantys, Refactor Comparator from wk01

Assertion Libraries, PM: Time Management

Test Olifantys

05

Streams, File IO, Try with Resources

CSV2Objects, LambdaLibrary

Maven / Build Tooling, Dependencies on Versions

Test CSV2Objects, LambdaLibrary

06

Threads & Sockets, Serialisation

Wordtransl. SimpleRestful

Mocking, Spy, Stubs

Test Sockets with Mocks (Mockito), Test Serialisation

07

JDBC

Simple Rest API Refactoring, Replace Map by DBTable

PM: Cost Management

-

08

REST-API (e.g. Jersey)

Testing Theory, Finding Testdatai, PM: Cost Management, Agile Principles and Mindset

Integration Tests, Rest Easy

09

State Machine, Regex

Gumballs, Templating

Value Driven Delivery, Stakeholder Engagement

Test Gumballs, Test Templating

10

Java FX Bindings

Clock

FDDi, Team Performance, Adaptive Planning

Test Bindings (Clock)

11

Java FX GUI, Architecture (Thin GUI)

Yahtzee

Mutation Tests (PIT), Problem Detection and Resolution

tbd

12

Reflection (Agents, Lombok)

Class Hierarchie

Continuous Improvement

tdb

13

Numbers & Computation

Decimal 2 Binary (Two Way binding)

tbd

tbd

14

tbd

tbd

tbd

tbd

You should start with the exercises in the week they are mentioned and hand them in through your personal subversion repository before the lessons in the next week start. There will be no new exercises in the last week.

Slack channel(s)

For questions and answers thus documenting them and also discussions and explanations, sharing information, links and other things between students and lecturers, feel free to use the slack channel: Slack invitation link. You are only allowed to use a fontys.nl email address. Using slack is optional, but if the students share their knowledge here, this can be a helpful source and learning environment.

1. Week1 Polymorphism, interfaces, Comparator and friends, Test Driven Development.

Week 1 rehearses some PRC1 stuff and introduces (unit) testing, the Java collection framework, and the Comparator as a way to make the collection very flexible.

Oracle tutorial on Interfaces and Inheritance and Collections.

Study tutorials before you come to class or practicum.

Sheets sets:

Responsible Teachers: PRC2: HOM, HVD; DVP: HOM, SBK.

1.1. Additional pointers

Start reading the fine manual (RTFM),in this case the api doc:

1.2. Demos

Lecture demo PRC2 about comparable, project in a zip. Complete the project according the tests.

1.3. Exercises


2. Week2 Exceptions and Logging

Sheets:

2.1. Additional pointers


2.2. Demos

Lecture demo PRC2 about comparable, project in a zip. Complete the project according the tests.

2.3. Exercises

2.4. Maven settings and repository

A maven repository is a server that provides ready built maven 'artifacts', such as (binary) jar files containing libraries, frameworks or APIs and in many (but not all) companion jar files containing the javadoc (often) and sources of the same binary. A maven repository is NOT a source code management system (CMS), although it typically holds several versions of a binary.

The is a default repository, called maven central. You (as team, comapny) can have your own repository. We at sebi Venlo did that too. Our repository lives at https://www.fontysvenlo.org/repository. Note that only teachers can put (jar) files in that repository. If you look at that repository you will see that it is organized along the three coordinate axis: groupId, artifactId and version.

To make this repository available for your own projects, add the following to your `~/.m2/settings.xml in the profiles section. You may also want to make that profile active.

adding fontysvenlo repo to your maven settings.
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <profiles>
        <profile>
            <id>sebivenlo</id>
            <repositories>
                <repository>
                    <id>fontysvenlo.org</id>
                    <url>https://www.fontysvenlo.org/repository</url>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>sebivenlo</activeProfile>
    </activeProfiles>
</settings>

Note that I am using an installed maven (3.5.2) which you can download from apache maven, not the one bundled with netbeans. You can tell netbeans (via tools→ options →java→maven) to use the installed one instead of the bundled on.

Doing this gives you the access to sebipom, which defines a parent pom for projects. This again provides some goodies that you otherwise have to provide yourselves. Such a parent pom is similar to a super class in Java; your pom inherits all the traits of the parent.

Including that parent is simple. See below for the sebipom (version 1.2).

sebipom as parent.
    <parent>
      <groupId>nl.fontys.sebivenlo</groupId>
      <artifactId>sebipom</artifactId>
      <version>1.2</version>
    </parent>

Some of the starter projects we provide already use this parent. To get that working, apply the settings above.

3. Week3 Enums & Generics - Project Management Basics

Constants with functionality and more on type safe storage.

Study the oracle tutorial on Enum and Generics:

Sheets sets:

3.1. DVP Theory - Project Management Basics

Today starts an introduction to the basics of project management.

Since a lot of work nowadays will be done in projects, it is important to understand what a project is, what not, what project management is about, which frameworks, tools and techniques are there and how to use them.

Questions

You can always ask question in slack in channel #dvp1 on fontysvenlo-ict.slack.com. Of course it is a good idea to not only ask questions, but also try to share your knowledge and answer the questions of other students.

3.2. Week 03 Exercises.

4. Java: Lambda & Streams. DVP: Assertion Libraries, Refactoring and Project Management in IT.

Java gets more functional since Java 8.

Study the oracle tutorial on Lambda and Streams:

Sheets sets:

There is also a summary on lambda under lambdaandfunctions.html

4.1. DVP Theory - Refactoring

Refactoring is an important task of software developers.

4.1.1. Slides week 3 - Refactoring

4.2. DVP Theory - Project Management in IT

Topics of today is Project Management in IT. Mainly it is about understanding how organizations are structured, about life cycles of projects and products and what project phases are.

Questions

You can always ask questions in slack in channel #dvp1 on fontysvenlo-ict.slack.com. Of course it is a good idea to not only ask questions, but also try to share your knowledge and answer the questions of other students.

4.2.1. Slides week3 - PM

4.3. Study the DVP test book.

In case you are missing directions for what to study of the test book (Unit Testing with JUnit and Mockito by Tomek Kaczanowski.): All of it, but not necessarily at once. We will apply several techniques from the book during the course, mainly in the lab exercises. Of course you may ask during class if there is a topic you do not understand (yet).

We did not add specific topics or order of topics in the study guide on purpose. For instance the way you can parameterize your test is shown in the book in several ways (e.g. in Chap 3). We have shown that in for instance the fraction solution, where we have demoed during class on Thursday 2018-02-22. We expect you to understand the concepts and be able to use an API (LG5, PRC2), even is it is a testing API.

4.4. Week 04 Exercises.

5. Java: Streams,Serialization and File IO, DVP: Time Management.

5.1. Java 8 Streams.

Study the oracle tutorial on Streams:

Consider a conveyor belt

filtering converyor belt

Read the summary on lambda and streams under lambdastreams.html.

5.2. File IO.

Interaction with the file system, writing object to streams and files.

Sheets sets:

5.4. DVP Theory - Project Management - Integration Management

Topic of today is Project Management the knowledge area of Integration Management.

Questions

You can always ask questions in slack in channel #dvp1 on fontysvenlo-ict.slack.com. Of course it is a good idea to not only ask questions, but also try to share your knowledge and answer the questions of other students.

Read the additional material on the website linked below and also watch the provided video for a short recap.

Integration Management in 2 Minutes

5.5. Week 5 - DVP Theory - Testing

This week, there will be no DVP slide set, but instead, class will be about demonstrating how to use parameterized tests and how you could have solved some homework tasks.

To study Testing: Assertion frameworks. Study the book Practical Unit Testing with Mockito, chapter about assertion frameworks.

AssertJ is the successor of FEST, and has an active developer community.

In particular Hamcrest and AssertJ are of interest here.

5.6. Week 05 Exercises.


6. Threads and sockets.

Program a simple client server file transfer.

For this week study Oracle Networking Tutorial, in particular the part "All About sockets".

Sheets and handhout

Sheets on sockets and threads sheets and handout

6.1. Week 06 Exercises.


7. Java Database Connectivity (JDBC)

How to work with a database directly from Java in a command line, desktop or web application.

Study the JDBC Introduction.

7.1. DVP Theory - Project Management

Topic of today is Project Management the knowledge area of Scope, Time and Cost Management.

Questions

You can always ask questions in slack in channel #dvp1 on fontysvenlo-ict.slack.com. Of course it is a good idea to not only ask questions, but also try to share your knowledge and answer the questions of other students.

7.1.1. Slides week7/week8 - PM - Scope/Time/Cost Management

Download the PERT example sheet below and also watch the provided video about scope creep.

Scope Creep - The Wasa

7.1.3. Homework

Do an estimation for the following activities (you can also take your PRJ2 tasks):

  • Analysis

    • Use Case diagram

    • Use Case description – Create Order

    • Use Case description – Add Customer

    • Use Case description – Create Invoice

    • Activity diagram – Order process

    • State machine – Order

Your task
  • Create e.g. an excel, list, table of your choice.

  • Use a 95.45% confidence (sigma)

  • List up the estimations with delta (+- standard deviation)

  • Post to #dvp slack channel

For a helpful tool see: PERT Estimation - example Excel Sheet

7.2. Week 07 Exercises.


8. RESTful Java with JAX-RS

Makes development of RESTful web services in Java simple.

8.1. Sheets and handhout PRC

Sheets on Restful services with JAX-RS sheets and handout

8.2. Sheets and handhout Testing

Sheets on testing and mocking restful services . By Loek Ehren and Rick van Osch.

A Guide to REST-assured on the baeldung site. Get acquainted with the concept. We will NOT use groovy etc. For that we have the workshop.

Intro to wire mock on the baeldung website.

The wiremock website will have more info on rest mocking.

For manual rest api testing the Advanced Rest Client could be used. It is based on nodjs, electron and chromium, the same technology stack as Atom, vs-code and more.

An alternative and nice and good looking rest inspection client Insomnia , suggested by Jordi Limpens.

logo Payara5, the preferred JEE constainer for PRC and Project 2. Payara are related to Piranha, also a well known bad-ass fish.

Payara the bad ass fish

8.5. DVP Theory - Cost Management

Questions

You can always ask questions in slack in channel #dvp1 on fontysvenlo-ict.slack.com. Of course it is a good idea to not only ask questions, but also try to share your knowledge and answer the questions of other students.

8.6. DVP Theory - Agile Principles and Mindset

See also the funny video about Scrum:

Scope Creep - The Wasa

8.7. Week 08 Exercises.


9. State machines and regular expressions

The PRC and DVP/Testing topics area

  • State machine

  • Regular Expressions

  • Mocking with Mockito

in no fixed order. State machines have been introduced in AAD1.

9.1. Extra bulletin on design and implementations

9.2. The testing topic first: Mockito

Demo in class. The OlifantysBalls exercise is a heavy user of mockito. See the exercises. You can read up in the book and look at the mockito javadoc/tutorial, which is available during the assessment as well. Make sure that you know where to find things.

Short slide set on mockito and dependency injection with annotations.

9.3. Regular expressions.

All modern languages support regular expressions. The perl flavor is the most common one, including in Java. Luckily that there is somewhat of a standard here.

We have few slides: regex slides and regex handout.

To study go to to the orcale turorial on regexes and also study the java.util.regex package, which has only one interface, two classes and one exception, so it should be doable. Note that we linked to the Java 9 version, which is searchable.

9.4. State Machines

We will explain in class that regular expressions also heavily rely on state machines. Luckily the regelar expression take the hard work of creating the state machine from you.

We will start the DVP class with state machines, and what is left over will be spent on Agile Processes.

State machines or charts can be implemented in several ways. We will use a modern OO approach using the well known State Pattern , enum and some Java 8 features, in particular default methods.

State Pattern and is nephew Strategy both have the same basic state, UML wise:

StatePattern
Figure 1. State Pattern

We deal with a context, an abstract state and concrete state instances that do the work and represent the state elements in the diagram. In the diagram above there would be a state instance for both ConcreteStateA and ConcreteStateB. In the our implementation we will be using enum as the basic construct for our work.

As an example: the gumball machine, whose state machine diagram looks like

State machine

and its class diagram like

State machine class diagram

A comlete narative on how to develop a statemachine test driven is available at having a ball with TDD. To get started, refreshen you knowledge by studying the book on Mockito, because that is what we are going to use here.

9.5. Week 09 Exercises.


10. JavaFX Bindings

10.1. Theory and slides on JavaFX Bindings.

There is a good tutorial about javafx bindings on the oracle website.

The slide set gives a summary of that.

10.2. Week 10 Exercises.


11. Java FX GUI, Architecture (Thin GUI)

11.1. Week 11 Exercises.


12. Reflection, the multi cutting edge

12.1. Week 12 Exercises.


13. Numbers & Computation

13.1. Week 13 Exercises.

TODO


14. Week 14 intentionally left vacant.

You will have sufficient work and questions to fill up the whole week ;-)

Solutions to various exercises.