CS计算机代考程序代写 Java concurrency 300144 Object Oriented Analysis

300144 Object Oriented Analysis
300888 Object Oriented Analysis (Advanced)

Tutorial 2 – UML (Week 3)

Student Name: ______________________________________

Student ID: ______________________________________

Tutorial Class: ______________________________________

Instructions to students –

• Attempt all questions

• This Tutorial will contribute to your final assessment mark

• The Tutor will check your solutions when you are finished

• OOA (Adv.) students need to complete optional questions.

Project Work:

• Students should now be working in groups with 3~5 members. Contact your tutor(s) and/or lecturer if you have not joined any groups yet.

• UML-based CASE tools (Microsoft VISIO) should be available in all CDMS computer laboratories. You can download this software (any versions in recent years) in your own computers. Besides, some other similar software is available on the Internet.

• Before starting your project by using the CASE tool, you need familiarise yourself with the software. Start MS VISIO and try to create some of the UML diagrams as given in the list: Use case, Activity, Class, Sequence, Interaction Overview, Communication, Object, State Machine, Composite Structure,
Component, Deployment, and Package.*

• Experiment with saving and opening diagrams that you have created. Please be advised that most of the practical works in following weeks of this semester are related to the project. Thus you need to save your weekly work appropriately.

* There is no requirement for correctness at this stage of the project work as this is just a practice to familiarise yourselves with the tool.

Tutorial Exercises:

• List at least 5 UML diagrams. Briefly explain nature and basics of these UML diagrams.

Class diagram:Class diagram is the most common and important diagram in object-oriented system modelling, and it is the basis of defining other diagrams. Class diagram is mainly used to show the static structure and relationship of class and interface in the system。

Package diagram:The package diagram describes the organizational structure of the model elements and the dependencies between packages, including package import and package extension. It also provides visualization of the corresponding namespace.

Activity diagram:Activity diagram is the state of something in progress, which can be a work in real life, or an operation of a class object in software system.

Sequence diagram: Sequence diagram, also known as sequence diagram and sequence diagram, is a UML interaction diagram. It shows the dynamic cooperation among multiple objects by describing the time sequence of messages sent between objects.

Use case diagram: Use case diagram is mainly used to describe roles and the connection between roles and use cases. It shows who will use the system and what they can do with it. A use case diagram contains multiple model elements, such as system, actor and use case, and shows various relationships among these elements, such as generalization, association and dependency. It shows a system function model diagram that can be observed by external users.

• List all UML diagrams that are dynamic-behavioural in nature. Explain your answer. (When there are conflicts from different resources, trust lecture notes/textbook)
Activity Diagram is a graphical representation of workflows of step-wise activities and actions with support for choice, iteration and concurrency.

Sequence Diagram shows the sequence of messages exchanged between the objects needed to carry out the functionality of the scenario.

State Machine Diagram shows the discrete behavior of a part of a designed system through finite state transitions.

Communication Diagram shows interactions between objects and/or parts using sequenced messages in a free-form arrangement.

• List three static-structural diagrams.
Class diagram,use case diagram, object diagram, component diagram, deployment diagram.

• Which UML diagrams are important from a business analyst’s point of view? What diagrams do you think you should use for this unit project? Explain your answer.
Use Case Diagram with the business is more important from the Business Analysts point of view.

• Which UML diagrams are important from a designer’s point of view? Explain your answer.
Sequence diagrams are the most important UML diagrams. As design-level models for business application development.

• (Optional) List UML diagrams that you would consider most valuable for models in the background modelling space.
I think it is a Use Case Diagram,Because it can clearly show who is going to use the system and what they can do with the system.
• (Optional) Compile and run the following java program.
Can we change the access specifier for the three instance variables (studentID, studentName and schoolName) of WSU_Student from protected to private without any other changes of the program? Explain your answer.

abstract class WSU_Student { protected String studentID; protected String studentName;
protected String schoolName;

WSU_Student (String sid, String name, String school)
{
studentID = sid; studentName = name;
schoolName = school;
}
abstract String setCourse (String courseCode); abstract void displayStudent();
}

class ICT_Student extends WSU_Student {
private String courseCode;

ICT_Student (String sid, String name, String school, String course)
{
super(sid, name, school);
courseCode = setCourse(course);
}
String setCourse(String course)
{
return course;
}
void displayStudent()
{
System.out.println(“\n”+this.studentID+”\n”+this.studentName+”\n”+ this.schoolName+”\n”+this.courseCode+”\n”);
}
}

class RegisterStudent {
public static void main(String[] args) {
WSU_Student oneStudent = new ICT_Student(“12345678”, “Tom Smith”,
“SCEM”, “3639”);
oneStudent.displayStudent();
}
}