• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Class notes

UML Diagrams and Writing Java Applications

Document preview thumbnail
Preview 2 out of 5 pages

UML diagrams are used so that programmers can quickly see the the idea of the classes they will write before they write them out. These diagrams are also used as a the communicating tool between programmers and other stakeholders such as sponsors of projects, the clients who wish to buy software and other programmers like the client programmers who will create objects from the class they write

Content preview

CSI21M1 Java Programming Notes, prepared by Mr. S. Nyika, Semester I, 2019


Lecture 2: UML Diagrams and Writing Java Applications

Objectives:
At the end of this lecture, students will be able to:
• use Unified Modeling Language to design a class
• write a Java class
• write a Java application
• use Camel Casing when writing Class name, variable identifiers and methods
• use appropriate conventions such as correct indentations in code blocks
• understand the need to use conventions in coding
• how to save a Java file

Notes:

Class Programmers design classes using Unified Modeling Language diagrams and after that they
write the source code of the class using the knowledge they have about Java classes as seen in lecture 1.
Suppose the class programmers needed to design a Student class, they would proceed and use a class
diagram which is a UML diagram. UML diagrams are used so that programmers can quickly see the
idea of the classes they will write before they write them out. These diagrams are also used as a
communicating tool between programmers and other stackholders such as sponsors of projects, the
clients who wish buy a software and other programmers like the client programmers who will create
objects from the class they write. There are a total of seven basic UML diagrams. These are:
• Class diagram
• Object diagram
• Component diagram
• Use case diagram
• Interaction diagram
• Statechart diagram
• Activitiy diagram

Class Diagram

Class diagrams basically represent the Object Oriented view of the system which is static in nature. It is
generally used for development purposes.

Use case diagram

A use case diagram are a set of use cases, actors and their relationship. They represent the use case
view of the system.




Page 1 of 5

, CSI21M1 Java Programming Notes, prepared by Mr. S. Nyika, Semester I, 2019

The Student class example

The UML class diagram




This diagram was written using a program called Dia Diagrams under Linux Operating System.The –
sign here shows that the fields are private and the + sign shows that the methods are public. Private and
public are called access specifiers. After the class diagram has been drawn, the class programmers now
write the source code of the class in an IDE of choice such as NetBeans as shown below:

The Student Class Source Code:




Page 2 of 5

Document information

Uploaded on
June 16, 2021
Number of pages
5
Written in
2020/2021
Type
Class notes
Professor(s)
Unknown
Contains
All classes
R50,00

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
1
Items
10
Last sold
5 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions