Programming And Introduction Of Software Application Report

Verified

Added on  2021/02/19

|20
|2787
|114
AI Summary

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
PROGRAMMING
1

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
2
Document Page
INTRODUCTION
UML diagrams are type of diagrams that are used for modelling and documenting
software’s, applications etc. These diagrams help in understanding a system, its processes and
functionalities in a better manner. UML diagrams helps in understanding a system in a better
manner and if there are any kind of flaws or errors within the system then it can be understood in
a better manner. These diagrams also help the programmer to understand all the functionalities of
the system and the way in which they interact with each other. This assignment will help in
describing various kinds of UML diagrams based on a case study in which a retail store wants to
implement an online retail store for their customer’s where customers will be able to place orders
through website. This assignment will also focus on java programs which will help in
understanding inheritance concept, interaction between class methods, abstract class and
interface implementation in java.
TAKS 1
Use case diagram
Use case diagram can be defined as a simplest way of representation of system and user’s
interaction (O'Hara and Slavin, 2019). This diagram shows relationship between users and
different use cases involved. In other words, this diagram can help in identifying different types
of system users and functions used by them. Below use case diagram represent actors and use
cases of online retail store.
3
Document Page
Figure 1 use case diagram of online retail store
Above use case diagram consist of two main actors: first is Admin and second is a customer.
Admin has four main functions: maintenance of item details i.e. which item is available and
which is not, update items that are available for home delivery, create reports of ordered items.
Customer’s also have access to four main functionalities of the system that are: browsing of
online store, selecting items for shopping, place order of selected items and pay for them and
lastly provide feedback to online retail store about their shopping experience.
4

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
TASK 2
Class Diagram
It is a static structure diagram which helps in describing the overall structure of the system
by showing various attributes, system classes, relationship between them. Class diagram are said
to be the main building blocks of OOM. It is also used as conceptual of application structures
modelling and it is also used for detailed modelling as well as model translating into
programming code (Jansen, 2015). Classes in this diagram represent both interactions in
applications, main elements and classes to be programmed. Below class diagram represent
classes, attributes and relationships of online retail store.
Figure 2 Class Diagram of online Retail Store
Above class diagram consist of seven classes that are: user, customer, shopping basket,
items, department, payment and review. Each class has its own attributes and all the classes are
inter related with each other i.e. each class has come relation with other classes.
5
Document Page
Object diagram
It is a static diagram that depicts a partial/complete view of modelled system structure at a
specific time. This diagram focuses on particular object sets, attributes and links between these
instances. It helps in gaining an insight of how an attribute view of the system evolution is
expected over time. It helps in showing a snapshot of system’s detailed state at a point in time.
This diagram is rarely used, namely it is only used in showing data structure examples. Both
class diagram and object diagram are closely related and uses almost same notations. In fact,
both the diagrams are mostly used to visualize static view of the structure with only one
difference i.e. object diagram displays class instance while class diagram displays classes. Below
object diagram represent objects, attributes and link between instances of online retail store.
Figure 3 Object diagram of online Retail Store
TASK 3
Sequence / activity / state diagrams
6
Document Page
Sequence diagram
It is one of an interaction diagram that depicts object interaction that are arranged in
sequence of time. It helps in depicting objects involved, message sequence that are exchanged
between objects so that required functionalities can be carried out (Mailund, 2017). This diagram
shows vertical lines known as lifelines, different processes that lives simultaneously, horizontal
arrows that depicts exchanged message between different processes in the same order in which
they occur. Below sequence diagram represent objects, processes lifelines, messages exchanged
between different processes of online retail store.
online retail
store website
product
cart
Process
order Logout order Summary
Online
customer
product
details
Add item
Shipping
charges
taxes
payment details
Display order item
Confirm
login
Add item
Processes
Figure 4 Sequence diagram of online retail store
Activity diagram
It helps in representing workflows of stepwise actions and activities with the help of
iterations, choices and concurrency. It is kind of a flow chart representation of activity flow.
These activities can be defined as representation of system. This diagram is basically drawn to
capture the system’s dynamic behaviour and shows message flow. This diagram is not only helps
7

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
in visualizing system’s dynamic behaviour but is also used to construct executable system by
using both reverse and forward engineering techniques. Below activity diagram represents flow
of activities of online retail store.
view items
customer login want to purchase No
yes
No
LogoutRequired product available or not
Go through
product details
Add to cart
Want to search new products
yes
Buy product
yes
search new items
Want to search new products
No
Add to cart
yes
No
generate purchase
details
Payment
select paymeny method
place order
Logout
Figure 5 Activity diagram of online retail store
State diagram
It helps in describing behaviour of the system. it also helps in describing dynamic view of
the system which further helps in describing finite number of states of the system. State diagram
exist in many forms i.e. it can be drawn in many forms. It can also be said that state diagram
8
Document Page
helps in providing a description of the system behaviour. This diagram represents event series
that can occur in many states possible. There are two state diagrams described below first is the
detailed state diagram that shows customers shopping states and second is a short state diagram
that shows customer’s journey.
User Login Varify
Relogin
User
Login
Invalid Login
users relogin Select shopping
items
Access online retail
store
Add/remove items
from shopping
basket
valid
login
access and select shopping items
update shopping basket
give feedback
payment details
make payment and
verify
place order
Logout
Provide review
logout
valid payment details
select mode of payment
enter payment details
make payment
again
invalid
payment
Customer pay's
again
Figure 6 State diagram of online retail store
Above state diagram describes detailed states of customer’s shopping experience of
online retail store.
9
Document Page
searching login
select item
registered
customer
selelct items
login
Register
new customer
Buying
buy itemsmore items
Pay bill
item selection over
logout
logout
Figure 7 State diagram for customer journey of online retail store
Above state diagram represents customer journey of online retail store.
TASK 4
Communication diagram
It is a simplified version of collaboration diagram and a type of interaction diagram which
helps in depicting messages passed between system objects that are defined. In other words,
communication diagram models interaction between objects and other parts of a system in a
sequenced manner (Ray, 2019). This diagram represents combined information of class, use case
and sequence diagram describing both dynamic and static behaviour of the system. However, it
uses free form arrangements of objects so that ordering of messages can be maintained as in free
form diagram. It starts with either 1.0 or 1. * message number and can end at any number. These
numbers are given so that flow of information can be understood in an easy manner. Below two
communication diagrams have been made. First diagram describes free flow of the information
and second diagram shows sequenced flow of overall system communication with the customer.
10

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Online retail store
:Online retail store
website
:items
:Shopping Cart
:Payment:Order
1.*: login()
1.1: search_item()
1.2: add_to_cart()
1.4: place_order()
2.*: logout()
2.2: update_item_list()
2.3: Update_shopping_cart()
2.1: make_order()
Figure 8 Communication diagram-1 of online retail store
Above communication diagram describes communication of customer with the online
retail store.
Customer
Account:Customer item Add_to_cart payment
Place order
:login(userid,password)
1:select_items()
4:place_order()
2:add_to_cart() 3:make_payment()
Figure 9 Communication diagram-2 of online retail store
Above communication diagram describes sequenced communication of customer with
the online retail store.
TASK 5
UML Component/deployment diagram
Component diagram
It is a kind of UML diagram which helps in depicting the way in which components are
together wired from large component system. these diagrams are mostly used to illustrate
structure of complex systems. It also helps in drawing model implementation details of system’s
11
Document Page
required functions that are covered by planned development. Component diagram is helpful for
system administrator as they can use this diagram to plan ahead using logical view of software
components and their relationship of the system. It consists of four main things component,
interface, dependencies and port. Below component diagram represents physical components
wired together.
Figure 10 Component diagram of online retail store
Deployment Diagram
Deployment diagram helps in depicting physical deployment of artefacts. It is mostly
drawn to describe hardware and software components of a system, website or application like
web server, application server, database etc. and ways in which these components are connected
to each other (Xinogalos, 2015). Nodes in the diagram can have sub nodes and may appear in
nested boxes. There are two types of nodes device nodes and execution environment nodes.
12
Document Page
Below deployment diagram represent software and hardware components such as database
server, application server etc. and nodes of online retail store.
Database Server Application server
Customer
Customer
Customer
Oracle server Application server.exe
<<LAN>> <<private network>>
Figure 11 Deployment diagram of online retail store
Above deployment diagram describes physical deployment of artefacts of online retail
store.
TASK 6
Implementation of hierarchy
Java is an object-oriented programming language which is class based. It is mostly used for
application development as it is platform independent i.e. code once and run anywhere.
Inheritance is one of the main mechanisms of java in which one object can acquire all behaviour
and properties of a parent object.
A process through which a class inherits or acquires properties and functionalities of
another class is known as inheritance (Tanielu and et.al., 2019). It helps in providing reusability
of codes so that all the common properties of the code can be directly acquired and only new or
unique properties will be required to be written. It can be done by extending base class properties
to derived class. In java all objects use inheritance. Below java program further helps in
understanding inheritance in java.
Program:
class Website //base class
{
13

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
public Website() {
System.out.println("Item");
}
public void price() {
System.out.println("Price");
}
}
class Shopping extends Website //derived class
{
public Shopping() {
super();
System.out.println("Mouse");
}
@Override
public void price() {
System.out.println("1000");
}
}
class Item extends Website //derived class
{
public Item() {
super();
System.out.println("Monitor");
}
@Override
public void price() {
System.out.println("2500");
}
}
class MainClass {
public static void main(String[] args) {
14
Document Page
Website website = new Website();
website.price();
Shopping shopping = new Shopping();
Item item = new Item();
website.price();
shopping.price();
item.price();
}
}
TAKS 7
Implementation of interaction
In java programming classes are a blueprint which helps in creating objects. These classes
help in representing set of method that are common to all objects with same properties. A typical
java program can create many objects that can help in invoking various methods. These objects
also helps in interacting with various methods of system’s class.
Program:
class Website
{
String name;
String item;
int price;
String colour;
public Website(String name, String item,
int price, String colour)
{
this.name = name;
this.item = item;
this.price = price;
this.colour = colour;
}
15
Document Page
public String getName()
{
return name;
}
public String getitem()
{
return item;
}
public int getprice()
{
return price;
}
public String getColour()
{
return colour;
}
@Override
public String toString()
{
return("Item name is "+ this.getName()+
".\nitem category,price and colour are: " +
this.getitem()+"," + this.getprice()+
","+ this.getColour());
}
public static void main(String[] args)
{
Website keyboard = new Website("Keyboard","computer items", 1000, "black");
System.out.println(keyboard.toString());
}
}
16

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
TASK 8
Abstract class and interface implementation in java
Abstraction is one of the main property of java which helps in hiding internal
implementation of features of functions and shows only functionalities. Abstraction can be done
in two ways first is by using abstract class and second using interface. Both abstract class and
interface are quite important pivots in OOP. Abstract classes are normal classes with some
unimplemented or undeclared methods in it. It can have one or more than one unimplemented
methods. Whereas interfaces are not classes, they are just interfaces that has no body inside it.
They simply consist of some undeclared methods, or final or static variables.
Abstract class implementation in java
Program:
abstract class Shopping1 //declaration of abstract class
{
Shopping1()
{
System.out.println("selected item and its price"); }
abstract void fun();
}
class Item1 extends Shopping1
{
Item1()
{
System.out.println("item Keyboard");
}
void fun()
{
System.out.println("price 1500");
}
}
class Main
17
Document Page
{
public static void main(String args[])
{
Item1 i = new Item1();
i.fun();
}
}
Interface implementation in java
Program:
interface Shop// declaration of interface
{
void view();
}
class Product implements Shop
{
public void view()
{
System.out.println("See Electronic items");
}
}
class Product2 implements Shop
{
public void view()
{
System.out.println("See grocessary items");
}
}
class TestInterface1// use of interface
18
Document Page
{
public static void main(String args[])
{
Shop d=new Product2();
Shop e=new Product();
d.view();
e.view();
}
}
CONCLUSION
Above assignment helps in understanding various kinds of UML diagrams like: class, use
case, object diagrams, sequence, activity, state diagram, communication diagram, component,
package and deployment diagram. This assignment has helped in understanding use of these
diagrams in understanding the overall functionalities of the system and these diagrams can be
used programming. It has also been analysed that UML diagrams can help in implementing
abstract classes, interfaces, inheritance and use of various class methods as well.
19

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
REFERENCES
Books and Journals
O'Hara, S. and Slavin, R., 2019, June. Modernizing parsing tools: parsing and analysis with
object-oriented programming. In Proceedings of the 8th ACM SIGPLAN International
Workshop on State Of the Art in Program Analysis (pp. 20-25). ACM.
Jansen, A., 2015. Using archival diplomatics and object-oriented programming to build
preservation objects in the Cloud. In 2015 Digital Heritage (Vol. 2, pp. 363-366). IEEE.
Mailund, T., 2017. Advanced Object-Oriented Programming in R: Statistical Programming for
Data Science, Analysis and Finance. Apress.
Ray, S., 2019. Fortran 2018 with Parallel Programming.
Xinogalos, S., 2015. Object-oriented design and programming: an investigation of novices’
conceptions on objects and classes. ACM Transactions on Computing Education (TOCE).
15(3). p.13.
Tanielu, T., and et.al., 2019, May. Combining Analogies and Virtual Reality for Active and
Visual Object-Oriented Programming. In Proceedings of the ACM Conference on Global
Computing Education (pp. 92-98). ACM.
20
1 out of 20
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]