Kent Institute Australia: Inventory System Design, DSAA204 Report
VerifiedAdded on 2022/11/17
|8
|2329
|53
Report
AI Summary
This report details the design of an inventory system for a company dealing with food and household items. It explores the selection of appropriate data structures and algorithms, justifying the choices based on their suitability for the project. The system design incorporates object-oriented programming principles, utilizing classes like Product, Household, Food, and Inventory. A class diagram illustrates the system's static and dynamic design. The report emphasizes the use of a queue data structure implemented with a linked list for managing products, detailing operations such as adding, removing, searching, and updating products. Algorithms for these operations, including iterative and recursive traversal, are presented and analyzed. The report also considers the system's ability to scale in response to increased data volume, such as a company merger, and concludes that the chosen data structures and algorithms can effectively handle such growth. The report also mentions the use of Java language for implementation, which is not included in the solution.

Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Contents
1 Introduction..............................................................................................................................................3
2 Variables, keys and ranges........................................................................................................................3
3 Algorithms and operations.......................................................................................................................6
4 Larger system changes.............................................................................................................................7
5 Conclusion................................................................................................................................................8
6 References................................................................................................................................................8
1 Introduction..............................................................................................................................................3
2 Variables, keys and ranges........................................................................................................................3
3 Algorithms and operations.......................................................................................................................6
4 Larger system changes.............................................................................................................................7
5 Conclusion................................................................................................................................................8
6 References................................................................................................................................................8

1 Introduction
This report presents a discussion on the analysis and design of the proposed inventory system to be
used by a company dealing with two types of items; food items and house hold items. The company is in
need of an inventory system thus there is need to determine the best data structures and algorithms to
be used for implementing the system and for each provide a justification as to why it’s the most suitable
for use in the project. The design of the system should be able to accommodate an increase in the data
handled by the application in the case where the company will merge with another company thus
leading to the increase in the data as a result of the increase in the inventory as well as the operations of
the company.
2 Variables, keys and ranges
To understand the static design of the system, a class diagram can be used to demonstrate the classes
and the attributes as well as the operations that will make up the system. For the inventory system, the
following class diagram can be used to represent the dynamic and static design of the system.
This report presents a discussion on the analysis and design of the proposed inventory system to be
used by a company dealing with two types of items; food items and house hold items. The company is in
need of an inventory system thus there is need to determine the best data structures and algorithms to
be used for implementing the system and for each provide a justification as to why it’s the most suitable
for use in the project. The design of the system should be able to accommodate an increase in the data
handled by the application in the case where the company will merge with another company thus
leading to the increase in the data as a result of the increase in the inventory as well as the operations of
the company.
2 Variables, keys and ranges
To understand the static design of the system, a class diagram can be used to demonstrate the classes
and the attributes as well as the operations that will make up the system. For the inventory system, the
following class diagram can be used to represent the dynamic and static design of the system.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Figure 1: Class diagram
Based on the diagram, the static design of the inventory system shows that the system will be designed
using objects. The objects that will make up the system will include;
Product- This object will be used to model a product item where each product item has specific
attributes that define the object; The attributes defining a product are;
o Name- This is the name of the product being stored. This attribute will be stored as a
string.
o Price- This is the cost of the product being stored. This attribute will be stored as a
double meaning that it will accept numbers with decimals.
o Type- The type attribute is used to store the type of product which can be defined as an
enum class having food or household types.
Based on the diagram, the static design of the inventory system shows that the system will be designed
using objects. The objects that will make up the system will include;
Product- This object will be used to model a product item where each product item has specific
attributes that define the object; The attributes defining a product are;
o Name- This is the name of the product being stored. This attribute will be stored as a
string.
o Price- This is the cost of the product being stored. This attribute will be stored as a
double meaning that it will accept numbers with decimals.
o Type- The type attribute is used to store the type of product which can be defined as an
enum class having food or household types.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

o Quantity on hand- The quantity on hand is used to store the quantity that is currently in
stock for a specific product. This attribute is defined as an integer.
Each of the attributes will have a mutator method which can also be called a setter method. The
setter method will be used to mutate the attribute by setting the value of the attribute. Another
method included for each attribute will be an accessor method which can also be called a getter
method. The accessor will be used to access or get the value held by the attribute. For example,
the get name accessor method is used to get the name of the product.
To initialize the object a constructor will be used where by each of the attributes defined for the
product will be passed as parameters using the parameterized constructor. Each object will have
two types of constructors; parameterized constructor and the default constructor. The
parameterized constructor will be used to define an object with data while the default
constructor will be used to define an object without data.
This object will also have equals method that will be used to compare two products and
determine whether or not they are the same. This will be useful for addition and updating of
products in the inventory.
Household- This object will be used to hold household products as shown in the class diagram
shown in figure 1 above. By interpreting the class diagram, the household object is a child class
of the product object. This means that the household object inherits all /operations and
attributes of the product object. Thus, each implementation of the household object will have to
implement the product. The household object will implement all the attributes and methods
defined on the parent class which is the product object. On top of that, the household object
will have the following attribute;
o Manufacturer- This attribute will be used to hold the manufacturer of the household
item. This attribute will be defined as a string.
The manufacturer attribute will have both an accessor and mutator method. The accessor
method will be used to access the value held by the attribute while the mutator method will be
used to mutate the value held by the attribute.
To initialize the household object, two types of constructors will be defined. A default
constructor and a parameterized constructor. The default constructor will be used to initialize
an empty or null household item while the parameterized constructor will be used to initialize a
household item with data. The parameterized constructor will take the all parameters of the
super class and the attribute of the household class. The parameters of the superclass will be
passed to the superclass.
Food- This object will be used to hold food items as shown n the class diagram in figure 1 above.
Just like the household item, the food object is a child class of the product object thus it inherits
all attributes and methods/operations of the product class. For the actual implementation of the
food object, the object will have to implement the product class to make inheritance between
the parent class and the child class. Apart from the attributes and methods defined by the
parent object, the food object will have the following attribute;
o Expiry date- this attribute will be used to hold the value of the expiry date of the food
item. This attribute will be defined as a date attribute.
The expiry date attribute will have an accessor to get the value held by the attribute and a
mutator method to mutate the attribute.
stock for a specific product. This attribute is defined as an integer.
Each of the attributes will have a mutator method which can also be called a setter method. The
setter method will be used to mutate the attribute by setting the value of the attribute. Another
method included for each attribute will be an accessor method which can also be called a getter
method. The accessor will be used to access or get the value held by the attribute. For example,
the get name accessor method is used to get the name of the product.
To initialize the object a constructor will be used where by each of the attributes defined for the
product will be passed as parameters using the parameterized constructor. Each object will have
two types of constructors; parameterized constructor and the default constructor. The
parameterized constructor will be used to define an object with data while the default
constructor will be used to define an object without data.
This object will also have equals method that will be used to compare two products and
determine whether or not they are the same. This will be useful for addition and updating of
products in the inventory.
Household- This object will be used to hold household products as shown in the class diagram
shown in figure 1 above. By interpreting the class diagram, the household object is a child class
of the product object. This means that the household object inherits all /operations and
attributes of the product object. Thus, each implementation of the household object will have to
implement the product. The household object will implement all the attributes and methods
defined on the parent class which is the product object. On top of that, the household object
will have the following attribute;
o Manufacturer- This attribute will be used to hold the manufacturer of the household
item. This attribute will be defined as a string.
The manufacturer attribute will have both an accessor and mutator method. The accessor
method will be used to access the value held by the attribute while the mutator method will be
used to mutate the value held by the attribute.
To initialize the household object, two types of constructors will be defined. A default
constructor and a parameterized constructor. The default constructor will be used to initialize
an empty or null household item while the parameterized constructor will be used to initialize a
household item with data. The parameterized constructor will take the all parameters of the
super class and the attribute of the household class. The parameters of the superclass will be
passed to the superclass.
Food- This object will be used to hold food items as shown n the class diagram in figure 1 above.
Just like the household item, the food object is a child class of the product object thus it inherits
all attributes and methods/operations of the product class. For the actual implementation of the
food object, the object will have to implement the product class to make inheritance between
the parent class and the child class. Apart from the attributes and methods defined by the
parent object, the food object will have the following attribute;
o Expiry date- this attribute will be used to hold the value of the expiry date of the food
item. This attribute will be defined as a date attribute.
The expiry date attribute will have an accessor to get the value held by the attribute and a
mutator method to mutate the attribute.

Inventory – This object will be used to hold products maintained by the inventory. This class will
contain method or operations that will maintain the inventory for example the add product,
delete product, update product among others.
The objects will be maintained using a queue data structure. A queue is an abstract data structure
that is usually similar to stacks but what makes it different from a stack is that a queue is open at
both ends of the queue. One end i.e. rear is used for insertion of data through a process called
enqueueing and the other end i.e. front is used for removal of data through a process called
dequeuing (www.javatpoint.com, n.d.).
The methodology used by a queue is first in first out (FIFO). This methodology specifies that the
piece of data stored first will be accessed first. A queue can be implemented using linked-lists,
structures, pointers or arrays. For the proposed application the queue will be implemented using a
linked-list as an array is not suitable for large scale operations. Implementation of a queue using a
linked list has 0(n) storage requirements and 0(1) for the time requirement of the operations. Each
node making up the queue will be made of two parts; data part which will hold the product object
and link part which will hold a pointer pointing to its immediate next node (Studytonight.com, n.d.).
A linked queue implementation maintains two pointers in the memory. These two pointers are;
o Front pointer- This pointer contains the address of the first node in the queue;
o Rear pointer- This pointer contains the address of the last element in the queue.
3 Algorithms and operations
For the proposed system to be operational, it will have various operations that will be used to maintain
the inventory.
The operations defined for the system are;
Add product- The system must have an operation or method that will support the user to add a
new product in the inventory. This operation will involve taking user input that define a product.
Adding a product in the linked queue will be done using the insert operation which involves
adding the object and its pointer at the end of the queue (Singh, 2018). Insertion of data in the
queue can happen in two scenarios;
o Empty queue- This scenario happens the queue is empty and a new element is inserted
into the queue. For this operation, front=null condition becomes true. The element will
be the only element in the que and the next pointer of front and rear will both point to
null. This operation can be demonstrated using an algorithm below;
Step 1: Allocate memory for the new node pointer
Step 2: check if front is null
Step 3; If front is null then front equals to pointer and rear equals pointer.
Step 4: Initialize the next front pointer as null and the next rear pointer as null.
o Non-empty queue- In this case, the queue contains one or more elements thus
front=NULL condition becomes false. The operation involved in tis operation involves
updating the end pointer rear so that the next rear pointer points to the new node
contain method or operations that will maintain the inventory for example the add product,
delete product, update product among others.
The objects will be maintained using a queue data structure. A queue is an abstract data structure
that is usually similar to stacks but what makes it different from a stack is that a queue is open at
both ends of the queue. One end i.e. rear is used for insertion of data through a process called
enqueueing and the other end i.e. front is used for removal of data through a process called
dequeuing (www.javatpoint.com, n.d.).
The methodology used by a queue is first in first out (FIFO). This methodology specifies that the
piece of data stored first will be accessed first. A queue can be implemented using linked-lists,
structures, pointers or arrays. For the proposed application the queue will be implemented using a
linked-list as an array is not suitable for large scale operations. Implementation of a queue using a
linked list has 0(n) storage requirements and 0(1) for the time requirement of the operations. Each
node making up the queue will be made of two parts; data part which will hold the product object
and link part which will hold a pointer pointing to its immediate next node (Studytonight.com, n.d.).
A linked queue implementation maintains two pointers in the memory. These two pointers are;
o Front pointer- This pointer contains the address of the first node in the queue;
o Rear pointer- This pointer contains the address of the last element in the queue.
3 Algorithms and operations
For the proposed system to be operational, it will have various operations that will be used to maintain
the inventory.
The operations defined for the system are;
Add product- The system must have an operation or method that will support the user to add a
new product in the inventory. This operation will involve taking user input that define a product.
Adding a product in the linked queue will be done using the insert operation which involves
adding the object and its pointer at the end of the queue (Singh, 2018). Insertion of data in the
queue can happen in two scenarios;
o Empty queue- This scenario happens the queue is empty and a new element is inserted
into the queue. For this operation, front=null condition becomes true. The element will
be the only element in the que and the next pointer of front and rear will both point to
null. This operation can be demonstrated using an algorithm below;
Step 1: Allocate memory for the new node pointer
Step 2: check if front is null
Step 3; If front is null then front equals to pointer and rear equals pointer.
Step 4: Initialize the next front pointer as null and the next rear pointer as null.
o Non-empty queue- In this case, the queue contains one or more elements thus
front=NULL condition becomes false. The operation involved in tis operation involves
updating the end pointer rear so that the next rear pointer points to the new node
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

pointer and the rear pointer has to point to the newly added node’s pointer. The next
pointer of rear has to point to null. This can be demonstrated using the following
algorithm;
Step 1: check if queue is full
Step 2: If the queue is full then an overflow error is displayed.
Step 3: if the queue is not full, increment rear pointer to point to null.
Step 4: add node to the location pointed by the rear pointer.
Remove product- Removing the product from the queue will be done using the dequeue
operation. This operation involves accessing the data being pointed by the form and removing
the data after accessing it. Removing a node from the queue will involve the following steps;
o Step 1: checking if the queue is empty;
o Step 2: if the queue is empty, display underflow error.
o Step 3: if the queue is not empty, access the data being pointed by the front pointer.
o Step 4: Increment the front pointer to point to the next available node.
Searching, updating a product and displaying understocked items- These operations will all rely
on traversal of the linked queue. There are two ways in which the linked queue can be
traversed;
o Iterative traversal- This method of traversal involves performing an incremental
traversal of the queue (Tutorialspoint.com, n.d.). For example, the traversal can start at
the front all the way to the rear of the queue but it’s done incrementally. Iterative
traversal of the queue can be done using the following steps;
Step 1: initialize a node pointer
Step 2: make current pointer equals to head pointer;
Step 3: start a loop; while current is not null
Step 4: if key of the current node equals key being searched for then return
true.
Step 5: make current equals current->next
o Recursive traversal- The algorithm of recursive traversal can be demonstrated using the
following steps;
Method search(head,x)
Step 1: if head equals NULL then return false
Step 2: if head’s key equals x return true
Step 3: Else return search (head->next,x)
The search operation will be done using iterative traversal since the number of products in the
system will support iterative traversal.
4 Larger system changes
If the company merged with another company and the number of products, the system would have to
be validated to make sure that the system will handle the new size of the inventory. This would include
validating each algorithm used for each of the operations for time complexity.
Adding and removing of a product in the queue data structure would not be affected if the size of the
inventory grows exponentially because of the merger. The most important operation is the search since
it form a basis of other operations like displaying understocked items. Since the queue will be
pointer of rear has to point to null. This can be demonstrated using the following
algorithm;
Step 1: check if queue is full
Step 2: If the queue is full then an overflow error is displayed.
Step 3: if the queue is not full, increment rear pointer to point to null.
Step 4: add node to the location pointed by the rear pointer.
Remove product- Removing the product from the queue will be done using the dequeue
operation. This operation involves accessing the data being pointed by the form and removing
the data after accessing it. Removing a node from the queue will involve the following steps;
o Step 1: checking if the queue is empty;
o Step 2: if the queue is empty, display underflow error.
o Step 3: if the queue is not empty, access the data being pointed by the front pointer.
o Step 4: Increment the front pointer to point to the next available node.
Searching, updating a product and displaying understocked items- These operations will all rely
on traversal of the linked queue. There are two ways in which the linked queue can be
traversed;
o Iterative traversal- This method of traversal involves performing an incremental
traversal of the queue (Tutorialspoint.com, n.d.). For example, the traversal can start at
the front all the way to the rear of the queue but it’s done incrementally. Iterative
traversal of the queue can be done using the following steps;
Step 1: initialize a node pointer
Step 2: make current pointer equals to head pointer;
Step 3: start a loop; while current is not null
Step 4: if key of the current node equals key being searched for then return
true.
Step 5: make current equals current->next
o Recursive traversal- The algorithm of recursive traversal can be demonstrated using the
following steps;
Method search(head,x)
Step 1: if head equals NULL then return false
Step 2: if head’s key equals x return true
Step 3: Else return search (head->next,x)
The search operation will be done using iterative traversal since the number of products in the
system will support iterative traversal.
4 Larger system changes
If the company merged with another company and the number of products, the system would have to
be validated to make sure that the system will handle the new size of the inventory. This would include
validating each algorithm used for each of the operations for time complexity.
Adding and removing of a product in the queue data structure would not be affected if the size of the
inventory grows exponentially because of the merger. The most important operation is the search since
it form a basis of other operations like displaying understocked items. Since the queue will be
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

implemented using a linked list, there will be no need to change the algorithms or the data structures
since the application will be able to handle the new size of the inventory.
5 Conclusion
Implementation of the proposed system using objects to model products and using a queue
implemented using a linked list would make operations of the system more effective and reliable
because of the reduced time complexity in the operations.
6 References
Tutorialspoint.com. (n.d.). Data Structure and Algorithms Linear Search - Tutorialspoint. [online]
Available at: https://www.tutorialspoint.com/data_structures_algorithms/linear_search_algorithm.htm
[Accessed 16 Sep. 2019].
www.javatpoint.com. (n.d.). Linked List Implementation of Queue - javatpoint. [online] Available at:
https://www.javatpoint.com/linked-list-implementation-of-queue [Accessed 16 Sep. 2019].
Studytonight.com. (n.d.). Queue Data Structure | Studytonight. [online] Available at:
https://www.studytonight.com/data-structures/queue-data-structure [Accessed 16 Sep. 2019].
Singh, R. (2018). Java Queue Interface Tutorial with Examples. [online] CalliCoder. Available at:
https://www.callicoder.com/java-queue/ [Accessed 16 Sep. 2019].
since the application will be able to handle the new size of the inventory.
5 Conclusion
Implementation of the proposed system using objects to model products and using a queue
implemented using a linked list would make operations of the system more effective and reliable
because of the reduced time complexity in the operations.
6 References
Tutorialspoint.com. (n.d.). Data Structure and Algorithms Linear Search - Tutorialspoint. [online]
Available at: https://www.tutorialspoint.com/data_structures_algorithms/linear_search_algorithm.htm
[Accessed 16 Sep. 2019].
www.javatpoint.com. (n.d.). Linked List Implementation of Queue - javatpoint. [online] Available at:
https://www.javatpoint.com/linked-list-implementation-of-queue [Accessed 16 Sep. 2019].
Studytonight.com. (n.d.). Queue Data Structure | Studytonight. [online] Available at:
https://www.studytonight.com/data-structures/queue-data-structure [Accessed 16 Sep. 2019].
Singh, R. (2018). Java Queue Interface Tutorial with Examples. [online] CalliCoder. Available at:
https://www.callicoder.com/java-queue/ [Accessed 16 Sep. 2019].
1 out of 8
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.