B7 Informatik 2 Summer 2024

Website of Prof. Dr. Barne Kleinen, Professor for Media Informatics (Bachelor/Master) at HTW Berlin

Lab 02: Programming & Tools, Review of CRC Model

     <prev next>

Learning Goals

After this lab you should be able to agree with each of the following statements

I am familiar with programming in IntelliJ:

  • I can create a new Java project in IntelliJ
  • I remember most of the concepts from A1 Ex1
  • I can run my new Java project in IntelliJ

I am ready to use Git:

  • I can clone an online repository
  • I can create an empty repository on GitLab or GitHub
  • I can update my local repository’s remotes
  • I can add changes to be committed
  • I can commit changes
  • I can push changes

I have reviewed the Domain Model

  • I have reviewed and improved the CRC Card Model
  • I feel ready to implement the application in Java using IntelliJ

Pre-Lab (Do this BEFORE the lab)

1. Prepare your work environment

The labs will be taught on campus. You can either

  • work on a lab computer
  • or work on the lab computers from remote (make sure to chose the lab that is given on your schedule)
  • or just work on your own laptop that you bring to class

If you decide to work on your own computer:

  • Install and set up git. You don’t need a Git GUI, you can use it via the command line or git bash.
  • Install and set up IntelliJ. The community edition should be sufficient (scroll down to see it), you can get an educational license for the IDEA Ultimate.

2. Prepare some more…

  • Sign in to GitHub or GitLabou can use any (nick)name you want, these must be handed in in moodle so I can recognize you.
  • Read through the entire info page on the labs and note down any questions.
  • Bring headphones to the lab - you will watch a video.

Lab

Assignment 1 - IntelliJ

In this assignment you will get to know the IDE we will be using: IntelliJ.

  1. Work through IntelliJ’s Create your first Java Program with IntelliJ. It will have a few new concepts or ones that you have not looked at in detail before! Find out the answers to the following questions:

a) What is an “IDE”?

b) What is a “JDK”?

c) What is a “package”?

d) What is a “library”?

e) Recap: What is the “main()” method in Java?

f) What is a “compiler”?

g) What is a “JAR”?

  1. Compare your answers with those of other people. What did they find out? Do you agree? Post any open questions in the class’ Moodle Forum. If you see any questions in the forum that you can answer, please answer them!

Assignment 2 - Git

  1. create Central Repo on Github or HTW Gitlab https://gitlab.htw-berlin.de/ as we did in class
  2. clone the repo to your local file system.
  3. how can you give the other members in your group access to your repo - first read, then write access?
  4. When everyone in your team has write access to the repo, practice exchanging little files via your central repo.

Here’s a brief list of the commands you will need in alphabetical order:

    git add 
    git commit -m "your commit message"
    git checkout <filename>
    git clone
    git pull [<remote> <branch>]
    git push [<remote> <branch>]
    git status
  1. Answer the following questions:

a) What does it mean to clone a repository?

b) What is a “remote” of a repository?

c) What does it mean to “commit changes”?

d) What happens if you “push” committed changes?

  1. Post any open questions in the Moodle Forum. See any questions there you can answer? Please try and answer them!

Assignment 3 - Model Review

We will talk about the models (CRC cars) you did last week in the lab. Submit your refined model as part of your lab report.

Submission

Submit your lab report and the link to your repository on Moodle. Make sure that the link is put in the available text field.

Deadline is 10pm before your next lab.