fall2010

Systems Modeling, Fall 2010, MTAT.03.083

Attention, I am still editing this page, please come back frequently. Discussion list is on http://discuss.sm.ulno.net. Homework has to be sent to systems-modeling at the ulno site (replace ulno in my email with systems-modeling). A shortcut to this page is http://sm.ulno.net.

News

  • 07.12.2010 results for course project are up.

  • Just to be complete: Here is the project grading table once more digitally (in addition to the paper form you got). Some comments I gave over the presentation on the discussion list: Most important for us is the demo of your application. However, the presentation should also show your commitment and a sample of your modeling work. You have only 10 minutes to present (max 2 minute questions, hard time limit as we have to deal with 16 teams in 180 minutes), so it is like a sales pitch. Prepare one laptop, which is able to present externally (try with an external monitor) on 1024x768 with 60 Hertz and has the slides and running program or screencast(s). So, show some demo paths. then the class diagram and some sample object diagrams/story boards and resulting tests, which you can run also. Try eventually to change roles while presenting. Practice the presentation so it runs fluently! Best and good luck, Ulrich

  • Two model view controller examples (both Fahrenheitconverters) as eclipse projects. here

  • 26.10.2010: On sandstorm.cs.ut.ee (login as SOLARIS\universityusername) you find eclipse with fujaba here: C:\Program Files\fujaba4eclipse-SDK-3.6.1-win32\eclipse\eclipse.exe

  • 26.10.2010: Attention, there was a mistake in the course schedule, it will be the 7th of December, when we present the work not the 6th. The 6th was a Monday.

  • 26.10.2010: Course project grading table: here, command pattern example (now updated, undo was not working for having multiple commands the same)

  • 19.10.2010: Material for lecture: here

  • 15.10.2010: Vistorpattern (and delgating file) for Filetree in Fujaba here.

  • 15.10.2010: Provided online versions of the screencasts.

  • 14.10.2010: Delegation example as ctr file.

  • 14.10.2010: Slides and homework updated, more screencasts online at fujaba.

  • 13.10.2010: The CounterVisitor example.

  • 12.10.2010: Very simple version of hanoi: here

  • 12.10.2010: Python preprocessing script for resolving merge conflicts in Fujaba ctr-Files. crt_resolve_conflict.py

  • 06.10.2010: Added more screencasts to here (from lecture).

  • 01.10.2010: Updated git usage scenarios.

  • 30.09.2010: Screencasts and object game online here (bottom of page) and here.

  • 28.09.2010: Some material for the lecture today: eclipse project

  • 27.09.2010: Small mistake in the second post-condition: corrected is "Post: Eero has now on his hand HK, HQ, Artjom has DJ, C8, H10, and Ulno has CA. The top of the deck shows DK, DQ, D10, D9 (DK is top card). On the top of the open deck are now all the cards, HA, H7. H7 is the top-most card of the open deck. It is now Artjom’s turn."

  • 24.09.2010: Concerning Mau Mau rules: Take the base rules with base rules with the Jack rule and the 7 rule to draw cards. After each hand is over the players except the one who won the hand count the points in their hands; the player with the most points is eliminated from the competition and play continues. Usually, kings are worth 50, queens and jacks are worth 20 each, aces are 1 each, and others have face value. If sombody plays an 8, the next person has to pass (will skip their turn). The Jack rule means: If you play a jack you can ask for a suit. You play a jack and then can select any suit with which the game should be continued (playing another Jack then is possible).

  • 21.09.2010: Material for new home work is here

  • 10.09.2010: Virtualbox-Image with all course software is now available at: http://vm.sm.ulno.net. Sorry, you will have to sacrifice 10GB of your precious diskspace for this course. Remove some movies and do exciting Systems Modeling exercises instead. ;-)

  • 06.09.2010: Remember to bring your notebooks and paper and pens.

  • 06.09.2010: Here are two links, you might need tomorrow: http://www.sparxsystems.com.au/resources/uml2_tutorial/uml2_usecasediagram.html and http://en.wikipedia.org/wiki/Use_case

  • 01.09.2010: First version of syllabus up, still lots of changes pending

Schedule

Classes will be Tuesdays from 14:15-15:45 in room 404 and 16:00-17:30 in room 405.

  • 07. Sep., Dr. Norbisrath, Introduction, Modelling and Abstraction, User Stories and Scenarios, Use cases, slides (and homework) hw: 6 pts

  • 14. Sep., Dr. Norbisrath, Objects, Object Diagrams, slides (and homework) hw: 5 pts

  • 21. Sep., Dr. Norbisrath, From Objects to Class Diagrams to Code, slides (and homework), extra material hw: 5pts (+1)

  • 28. Sep., Dr. Norbisrath, Test Driven Development, Storyboards, Method design, the Object Game, slides100928.pdf

  • 05. Oct., Dr. Norbisrath, Modeling in Fujaba, Story diagrams, Design patterns start, slides (and homework) hw: 8pts (+4)

  • 12. Oct., Dr. Norbisrath, More Modeling in Fujaba, Coobra (distributed modeling), design patterns, slides

  • 19. Oct., Dr. Norbisrath, Interfacing Fujaba, more design Patterns, slides (and homework)

  • 26. Oct., Dr. Norbisrath, Interfacing Fujaba, practice session, Questions and Tips and Tricks, slides

    1. Nov., Dr. García-Bañuelos, Statemachines

    1. Nov., Dr. García-Bañuelos, Statemachines

    1. Nov., Prof. Marlon, Petri nets

    1. Nov., Prof. Marlon, Petri nets

    1. Nov. deadline for course project

    1. Dec. , Dr. Ulrich Norbisrath, Course project presentation

Course Project

We will develop a multiplayer version of the game Mancala in this course as course project.You can see an example implementation here. Wikipedia has some nice compact rules here. The project report you will have to hand in has to consist of a guide through your project (and repository), your project plan, project log, and documentation.

Grading

One will get points for each of the following:

  • participation in 12 lectures: 10 points

  • homework (24) + course project (36): 60 points

  • statemachine: 20 points

  • petri nets: 10 points

The maximum points one can achieve in this course are 100 points. The grading scheme is the following: 100-91:A, 90-81:B, 80-71:C, 70-61:D, 60:-51:E, 50-0:F There will not be an exam in this course. Doing good homework, showing active participation in the lecture, and doing a good course project will be your way to a successful course. The participation points as well as the homework points are available here. The project grading is at the bottom of this page.

Structure/Homework

The participation in the course is compulsory. If you can't attend, you have to present a valid excuse to me in advance. You will work in teams of 3-4 persons (for some bigger tasks I might merge some teams). The lectures will usually start with the presentation of the last homework, presented by selected persons of selected teams. Everybody in a team, must be able to present the homework. We will start each of the classes (2nd to 8th) with a homework presentation. There, I will pick a team and a person in the team to present. If this persons is not present or fails to present, I will deduct 1 point from your homework points for this day and pick another one of the team. If this persons also fails, I will deduct another point. Homeworks will usually give around 5 points, some might give more and some first very easy homeworks may give only 3-4 points. Homework has to be sent to systems-modeling until the following Monday morning at the ulno site (replace ulno in my email with systems-modeling). The subject of the homework has to have the form "[SM] <homework-number> <sorted – low to high - matrikel numbers of team members>". As an example, if your team members have matrikel numbers A11111, B11111, A11121 than the title would look like this for the first homework assignment:

  • [SM] 1 A11111 A11121 B11111

Version management with git

In the course we will use Git, the distributed version control system developed by Linus Torvalds. Git is one of the best version control systems (read short comparison here), it is optimal for small distributed development teams. The binary packages can be downloaded here, alternatively on linux you can install the following packages from the repository:

git-core git-gui gitk

Git is already installed in our virtual machine. Try to run git gui. Here is a good tutorial, this should help to understand Git and the difference between centralized and decentralized version control systems. Here is complete tutorial how to use git. Git also has a graphical user interface, here is a nice tutorial for windows users. For linux users there is no need for Putty client since git is using standard ssh client. To start git graphical user interface type:

git gui

in terminal and follow instructions from the tutorial.

Setting up shared git repository

If you think understand the decentralized approach, you can try to synchronize with your team members in pure distributed manner. In this case each team member has to publish his git repository on his home page (_http://www.ut.ee/~user/repository). Alternatively you can publish your repository on github. Read this tutorial. The github-approach is more-less centralized. For those who choose distributed approach we provide example scenarios with 3 users (Alice,Bob and Diane). If you are scared of using command line, you can use git gui to manage git repositories (see the manual we provided before).

#1 Alice initializing repository

Assume Alice has some folder work, she wants to track the changes using git repository. The actions are:

  • Navigate to work folder (assume /home/alice/work), initialize local git repository, make initial commit:

## Navigate to work folder

alice@local:~$ cd ~/work

alice@local:~/work$ ls -1

file001.txt

file002.txt



## Initialize repository

alice@local:~/work$ git init

Initialized empty Git repository in /home/alice/work/.git/

alice@local:~/work$ ls -a1

.

..

file001.txt

file002.txt

.git



## Review local configurations

alice@local:~/work$ git config -f .git/config -l

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true



## Specify user name (used to sign commits)

alice@local:~/work$ git config -f ./.git/config user.name  "Alice"

alice@local:~/work$ git config -f ./.git/config user.email "alice@ut.ee"

alice@local:~/work$ git config -f .git/config -l

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

user.name=Alice

user.email=alice@ut.ee



## Show the working tree status

alice@local:~/work$ git status

# On branch master

#

# Initial commit

#

# Untracked files:

#   (use "git add <file>..." to include in what will be committed)

#

#       file001.txt

#       file002.txt

nothing added to commit but untracked files present (use "git add" to track)



## Track all files

alice@local:~/work$ git add -A

alice@local:~/work$ git status

# On branch master

#

# Initial commit

#

# Changes to be committed:

#   (use "git rm --cached <file>..." to unstage)

#

#       new file:   file001.txt

#       new file:   file002.txt

#



## Commit all changes (two added files)

alice@local:~/work$ git commit -a -m "Added some text"

[master (root-commit) 7c6deb8] Added some text

 2 files changed, 5 insertions(+), 0 deletions(-)

 create mode 100644 file001.txt

 create mode 100644 file002.txt

alice@local:~/work$ git status

# On branch master

nothing to commit (working directory clean)
  • Now the files in work folder are tracked using git repository

#2 Alice publishing repository

Alice has a local git repository in work folder, she wants to share it to her friends (Bob,Diane) using git and her home folder at ats.cs.ut.ee server. The actions are:

  • Login to ats.cs.ut.ee, setup bare git repository (this one will be used to push Alice's changes from local repository), make it public:

## Login to ats.cs.ut.ee

alice@local:~/work$ ssh -v alice@ats.cs.ut.ee

alice@ats.cs.ut.ee's password:

[alice@socrates ~]$



## Navigate to public_html, create repository foder, this will contain bare git repository

[alice@socrates ~]$ cd public_html

[alice@socrates ~/public_html]$ mkdir repository



## Give it the read/execute permissions

[alice@socrates ~/public_html]$ chmod a+rx repository



## Initialize bare git repository

[alice@socrates repository]$ git init --bare

Initialized empty Git repository in ~/public_html/repository/

[alice@socrates repository]$ ls -1

branches

config

description

HEAD

hooks

info

objects

refs



## Enable post-update scripts

[alice@socrates repository]$ cp hooks/post-update.sample hooks/post-update



## Bare repository is ready, give read/execute permissions to public_html and home folder

[alice@socrates repository]$ cd ~/

[alice@socrates ~]$ chmod a+rx public_html

[alice@socrates ~]$ chmod a+rx ../alice



## Show absolute path of the home directory, this will be needed in the next step

[alice@socrates ~]$ pwd

/home/murakas/a/alice

[alice@socrates ~]$ exit

alice@local:~/work$
Index of /~alice/repository

    *  Parent Directory

    * HEAD

    * branches/

    * config

    * description

    * hooks/

    * info/

    * objects/

    * refs/
  • Push the local changes to publshed repository at ats.cs.ut.ee using ssh

## Add remote repository called "public-ssh" pointing to /home/murakas/a/alice/public_html/repository on ats.cs.ut.ee

alice@local:~/work$ git remote add public-ssh ssh://alice@ats.cs.ut.ee/home/murakas/a/alice/public_html/repository



## List remotes

alice@local:~/work$ git remote show

public-ssh



## Fetch changes (just to be sure it remote is setup correctly)

alice@local:~/work$ git fetch public-ssh

alics@ats.cs.ut.ee's password:

alice@local:~/work$



## List branches

alice@local:~/work$ git branch -a

* master



## Push changes from local branch "master" to remote repository "public-ssh"

alice@local:~/work$ git push public-ssh master

alice@ats.cs.ut.ee's password:

Counting objects: 4, done.

Delta compression using up to 2 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (4/4), 268 bytes, done.

Total 4 (delta 0), reused 0 (delta 0)

To ssh://alice@ats.cs.ut.ee/home/murakas/a/alice/public_html/repository

 * [new branch]      master -> master



## List branches (remote master branch listed)

alice@local:~/work$ git branch -a

* master

  remotes/public-ssh/master



## View log, short format (--oneline), print asci graph of commits (--graph)

alice@local:~/work$ git log --graph --oneline

* 7c6deb8 Added some text
7c6deb8397ab8e30b17034a8bf6cd18810fa7e0f        refs/heads/master
#3 Bob and Diane cloning Alice's published repository

Bob has an address of Alice's published repository "http://www.ut.ee/~alice/repository". He wants to fetch the code for development. The actions are:

  • Clone Alice's repository

## Navigate to workspace

bob@local:~$ cd ~/workspace

bob@local:~/workspace$



## Clone Alice's repository from "http://www.ut.ee/~alice/repository" to ~/workspace/alice_work

bob@local:~/workspace$ git clone http://www.ut.ee/~alice/repository alice_work

Initialized empty Git repository in /home/devel/workspace/alice_work/.git/

bob@local:~/workspace$ cd alice_work

bob@local:~/workspace/alice_work$ ls -1AhpS

.git/

file001.txt

file002.txt



## Don't forget to pass user.name and user.email to config file. So the commits will be automatically subscribed.

bob@local:~/workspace/alice_work$ git config -f ./.git/config user.name  "Bob"

bob@local:~/workspace/alice_work$ git config -f ./.git/config user.email "bob@ut.ee"

bob@local:~/workspace/alice_work$ git config -f ./.git/config -l

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

remote.origin.url=http://www.ut.ee/~alice/repository

branch.master.remote=origin

branch.master.merge=refs/heads/master

user.name=Bob

user.email=bob@ut.ee
  • Now bob has a clone of Alice's repository, he is ready to develop.

Assume Diane does the same (in respekt to hers username).

#4 Bob making changes; Diane,Alice synchronizing

Bob cloned Alice's repository from "http://www.ut.ee/~alice/repository" and made changes to the code. He wants to share his changes to Alice and Diane. The actions are:

  • Commit changes, and publish the local repository

## Check the current status of the repository:

bob@local:~/workspace/alice_work$ git status

# On branch master

# Changed but not updated:

#   (use "git add <file>..." to update what will be committed)

#   (use "git checkout -- <file>..." to discard changes in working directory)

#

#       modified:   file001.txt

#       modified:   file002.txt

#

# Untracked files:

#   (use "git add <file>..." to include in what will be committed)

#

#       file003.txt

no changes added to commit (use "git add" and/or "git commit -a")



## There are one new file, add it to version control, use -A to add all

bob@local:~/workspace/alice_work$ git add -A

bob@local:~/workspace/alice_work$ git status

# On branch master

# Changes to be committed:

#   (use "git reset HEAD <file>..." to unstage)

#

#       modified:   file001.txt

#       modified:   file002.txt

#       new file:   file003.txt

#



## Now all files are tracked, commit the changes, use -a to commit all

bob@local:~/workspace/alice_work$ git commit -a -m "Added some lines"

[master 96b36ba] Added some lines

 3 files changed, 9 insertions(+), 1 deletions(-)

 create mode 100644 file003.txt



## Check status, it is Bob's branch is ahead of Alice's one.

bob@local:~/workspace/alice_work$ git status

# On branch master

# Your branch is ahead of 'origin/master' by 1 commit.

#

nothing to commit (working directory clean)
## Prepare the bare repository in the home folder on '''ats.cs.ut.ee'''

#    FOLLOW THE STEPS DESCRIBED IN #2 (preparing bare repository and pushing local changes to it)

##



## Check the remote repositories

bob@local:~/workspace/alice_work$ git remote show

public-ssh



## Check the remote branches

bob@local:~/workspace/alice_work$ git branch -a

* master

  remotes/public-ssh/master
  • Now Bob has his published his repository on "http://www.ut.ee/~bob/repository". Diane and Alice can fetch Bob's changes.

  • Alice connects Bob's published repository, fetches the changes and merges into her local branch.

## Add remote repository "http://www.ut.ee/~bob/repository", named it 'bob-http'

alice@local:~$ cd ~/work

alice@local:~/work$ git remote add bob-http http://www.ut.ee/~bob/repository

alice@local:~/work$ git remote show

bob-http

public-ssh



## Fetch the changes from Bob's remote repository,

alice@local:~/work$ git fetch bob-http

 * [new branch]      master     -> bob-http/master



## Show remote branches, 'remotes/bob-http/master' carries Bob's changes

alice@local:~/work$ git branch -a

* master

  remotes/bob-http/master

  remotes/public-ssh/master



## Merge Bob's changes into the local 'master' branch

## 1. Check you current branch, should be 'master', no un-commited  changes

alice@local:~/work$ git status

# On branch master

nothing to commit (working directory clean)



## 2. Merge the changes from 'bob-http/master' into 'master'

alice@local:~/work$ git merge bob-http/master

Updating 7c6deb8..96b36ba

Fast-forward

 file001.txt |    2 +-

 file002.txt |    1 +

 file003.txt |    7 +++++++

 3 files changed, 9 insertions(+), 1 deletions(-)

 create mode 100644 file003.txt



## Now check log, should contain Bob's commits

alice@local:~/work$ git log --graph --oneline

* 96b36ba Added some lines

* 7c6deb8 Added some text



## More details

alice@local:~/work$ git log --graph

* commit 96b36baf6924ee5aaebe6a0b77a5375f95a155f2

| Author: Bob <bob@ut.ee>

| Date:   Fri Oct 1 14:40:37 2010 +0300

|

|     Added some lines

|

* commit 7c6deb8397ab8e30b17034a8bf6cd18810fa7e0f

  Author: Alice <alice@ut.ee>

  Date:   Thu Sep 16 17:35:07 2010 +0300



      Added some text
  • Now Alice has Bob's changes in her local repository and she is ready to develop.

  • Assume Diane does the same (in respekt to hers username)

#5 Complete distributed repository

In complete distributed repository:

  • every peer has to be able to publish his/her changes.

    • Bob and Alice did publish the repositories.

  • every peer has the remote (published) repositories of other Peers attached to the local one.

    • Bob and Diane did attach Alice's repository (while cloning it)

    • Alice and Diane did attach Bob's repository manually

Now Diane has to publish her local repository, Bob and Alice have to attach it to their local repositories:

## Prepare the bare repository in the home folder on '''ats.cs.ut.ee'''

#    FOLLOW THE STEPS DESCRIBED IN #2 (preparing bare repository and pushing local changes to it)

##
  • Alice connects Diane's repository, fetches changes, merges them into local branch

##

#    FOLLOW THE STEPS DESCRIBES IN #4 (Alice connects Bob's published repository ...

#          - Use 'diane-http' as remote repository name

#          - Use "http://www.ut.ee/~diane/repository" as an address of remote repository

##
  • Bob connects Diane's repository, fetches changes, merges them into local branch (same as previous in respect to Bob's name)

#6 Merging conflicts

Wiki: A conflict occurs when different parties make changes to the same document, and the system is unable to reconcile the changes. A user must resolve the conflict by combining the changes, or by selecting one change in favour of the other. Scenario: * Alice developed the code, she commits it, and pushes the changes to her published repository over ssh

alice@local:~/work$ git status

# On branch master

# Changed but not updated:

#   (use "git add <file>..." to update what will be committed)

#   (use "git checkout -- <file>..." to discard changes in working directory)

#

#       modified:   file001.txt

#

no changes added to commit (use "git add" and/or "git commit -a")



alice@local:~/work$ git commit -a -m "Modified one line"

[master b60c261] Modified one line

 1 files changed, 1 insertions(+), 1 deletions(-)



## Push changes to the published repository on "http://www.ut.ee/~alice/repository"

alice@local:~/work$ git push public-ssh master

alice@ats.cs.ut.ee's password:

Counting objects: 11, done.

Delta compression using up to 2 threads.

Compressing objects: 100% (4/4), done.

Writing objects: 100% (8/8), 638 bytes, done.

Total 8 (delta 0), reused 0 (delta 0)

To ssh://alice@ats.cs.ut.ee/home/murakas/a/alice/public_html/repository

   7c6deb8..b60c261  master -> master

* Bob developed the code, commited it, next he fetches Alice's changes, there are conflicts and manual merge required

## Check the changes

bob@local:~/workspace/alice_work$ git status

# On branch master

# Changed but not updated:

#   (use "git add <file>..." to update what will be committed)

#   (use "git checkout -- <file>..." to discard changes in working directory)

#

#       modified:   file001.txt

#

no changes added to commit (use "git add" and/or "git commit -a")



## Commit the changes (be aware: this is a local commit)

bob@local:~/workspace/alice_work$ git commit -a -m "Modified the code"

[master 837520f] Modified the code

 1 files changed, 1 insertions(+), 1 deletions(-)



bob@local:~/workspace/alice_work$ git status

# On branch master

nothing to commit (working directory clean)



bob@local:~/workspace/alice_work$ git log --graph

* commit 837520fef3cde51d65bb2c0551d3c661a60f09e0

| Author: Bob <bob@ut.ee>

| Date:   Mon Oct 4 17:15:33 2010 +0300

|

|     Modified the code

|

* commit b60c261bc59a09719100017e4bc6350922c14bf1

| Author: Alice <alice@ut.ee>

| Date:   Fri Oct 1 16:29:02 2010 +0300

|

|     Modified one line

|

* commit 96b36baf6924ee5aaebe6a0b77a5375f95a155f2

| Author: Bob <bob@ut.ee>

| Date:   Fri Oct 1 14:40:37 2010 +0300

|

|     Added some lines

|

* commit 7c6deb8397ab8e30b17034a8bf6cd18810fa7e0f

  Author: Alice <alice@ut.ee>

  Date:   Thu Sep 16 17:35:07 2010 +0300



      Added some text



## Fetch Alice's changes

bob@local:~/workspace/alice_work$ git fetch alice-http

From http://www.ut.ee/~alice/repository

   b60c261..cd2d75b  master     -> alice-http/master



## Merge chenages from 'alice-http/master' into current branch (master)

bob@local:~/workspace/alice_work$ git merge alice-http/master

Auto-merging file001.txt

CONFLICT (content): Merge conflict in file001.txt

Automatic merge failed; fix conflicts and then commit the result.



## Browse the conflicts

bob@local:~/workspace/alice_work$ cat file001.txt

Line 001 abcde

<<<<<<< HEAD

Line 002 12345

=======

Line 002 fghijk

>>>>>>> alice-public/master

Line 003



## Edit file001.txt, merge the changes on second line, remove conflict indicators

bob@local:~/workspace/alice_work$ cat file001.txt

Line 001 abcde

Line 002 12345 fghijk

Line 003



## Check the changes

bob@local:~/workspace/alice_work$ git status

# On branch master

# Unmerged paths:

#   (use "git add/rm <file>..." as appropriate to mark resolution)

#

#       both modified:      file001.txt

#

no changes added to commit (use "git add" and/or "git commit -a")



## Now mark 'file001.txt' as 'resolved'

bob@local:~/workspace/alice_work$ git add file001.txt

bob@local:~/workspace/alice_work$ git status

# On branch master

# Changes to be committed:

#

#       modified:   file001.txt

#



## Commit the changes (merged files)

bob@local:~/workspace/alice_work$ git commit -a -m "Merged file001.txt"

[master 4daa9a4] Merged file001.txt



## Check the log

bob@local:~/workspace/alice_work$ git --graph --oneline

*   4daa9a4 Merged file001.txt

|\

| * cd2d75b Modified Second line

* | 837520f Modified the code

|/

* b60c261 Modified one line

* 96b36ba Added some lines

* 7c6deb8 Added some text



## Now publish the merged code

bob@local:~/workspace/alice_work$ git push public-ssh master

Counting objects: 11, done.

Delta compression using up to 2 threads.

Compressing objects: 100% (6/6), done.

Writing objects: 100% (9/9), 927 bytes, done.

Total 9 (delta 0), reused 0 (delta 0)

To ssh://artjom85@ats.cs.ut.ee/home/murakas/b/bob/public_html/repository

   b60c261..4daa9a4  master -> master
  • Now Bob merged his changes and Alice's changes, the merged code is in his published repository. Alice and Diane have to synchronize now before commiting their changes.

## Check log

alice@local:~/work$ git log --graph --oneline

* cd2d75b Modified Second line

* b60c261 Modified one line

* 96b36ba Added some lines

* 7c6deb8 Added some text



## Fetch Bob's changes

alice@local:~/work$ git fetch bob-http

From http://www.ut.ee/~bob/repository

   b60c261..4daa9a4  master     -> bob-http/master



## Merge Bob's changes into current branch (master)

alice@local:~/work$ git merge bob-http/master

Updating cd2d75b..4daa9a4

Fast-forward

 file001.txt |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)



## Check log

alice@local:~/work$ git log --graph --oneline

*   4daa9a4 Merged file001.txt

|\

| * cd2d75b Modified Second line

* | 837520f Modified the code

|/

* b60c261 Modified one line

* 96b36ba Added some lines

* 7c6deb8 Added some text
  • Now Alice's has the code (merged by Bob's) in her local repository, she is ready to develop.

  • Assume Diane doing the same with respect to her name

This scenario explained how to merge simple conflicts (two persons edited the same line simultaneously)

VirtualBox tricks

Sharing host-filesytem

In order to access the files on your host-filesystem from virtualbox you need to setup shared folder:

  1. Load VirtualBox and boot the SM virtual machine (the one you use in the course)

  2. After booting open the list of Shared Folders (Top Menu->Devices->Shared Folders)

  3. Add new entry (click Add Share)

  4. Specify Folder path to the preferred folder (/home/devel/Documents in my case)

  5. You can modify Folder name (by default same as in host-filesystem, Documents in my case)

  6. Check Read-only only if you are sure you don't need to write to host-filesystem

  7. Check Make Permanent only if you are sure you need the Shared folder only once for this session

  8. Click OK, click OK once again.

  9. Now in your virtual machine (Ubuntu) open Command Promt (Xfce Menu -> Terminal)

  10. Edit fstab file (don't forget sudo password is 12345):

sudo gedit /etc/fstab
  • Add the following line. In place of <Folder name> use the name you specified in step (5):

<Folder name>   /media/host     vboxsf  rw,uid=user,gid=user,fmask=077,dmask=077        0       0
  • In my case it looks like this:

Documents       /media/host     vboxsf  rw,uid=user,gid=user,fmask=077,dmask=077        0       0
  • Save changes, close editor, and remount your drives:

sudo mount -a

Now your shared folder is mounted to /media/host, you should be able to access the files:

cd /media/host

ls -ahlp

NB! Since we have stored the mount point in /etc/fstab, the shared folder will be automatically mounted each time you boot the virtual machine, however be careful and not rename/delete your shared folder on the host-filesystem.

Resources

  • Virtual box image: http://vm.sm.ulno.net

  • Rumbaugh, J., Blaha, M., Premerlani, W., Eddy, F., & Lorensen, W. (1991). Object-oriented modeling and design. Prentice-Hall, Inc. Upper Saddle River, NJ, USA.

  • Larman, C. (1998). Applying UML and Patterns: An Introduction to Object-oriented Analysis and Design. Prentice Hall PTR.

  • Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1995). Design patterns: elements of reusable object-oriented software. Addison-Wesley Reading, MA.

  • Barnes, D. J., & Kolling, M. (2006). Objects First With Java: A Practical Introduction Using BlueJ. Prentice-Hall, Inc. Upper Saddle River, NJ, USA.

  • Virtual image for development environment (includes Eclipse, Fujaba, and Dia): here

  • Albert Zündorf - Story Driven Modeling

  • More nice material on designpatterns (credits to Egon): http://gameprogrammingpatterns.com/