

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















❒ Summative Feedback: ❒ Resubmission Feedback:
ASSIGNMENT 1 BRIEF
Scenario : You have recently joined a software development company to help improve their documentation of their in-houses software libraries which were developed with very poor documentation. As a result, it has been very difficult for the company to utilise their code in multiple projects due to poor documentation. Your role is to alleviate this situation by showing the efficient of UML diagrams in OOAD and Design Patterns in usages. Tasks You and your team need to explain characteristics of Object-oriented programming paradigm by applying Object-oriented analysis and design on a given (assumed) scenario. The scenario can be small but should be able to presents various characteristics of OOP (such as: encapsulation,
For example: In my program, I create an “car” class with the variable ”orange”. We can use the “car” class to create an object “Bumblebee” then print its color. ➡ Page | 2
2.2. Encapsulation In software systems, encapsulation refers to the bundling of data with the mechanisms or methods that operate on the data. It may also refer to the limiting of direct access to some of that data, such as an object's components. In short, Encapsulation exists to make sure "sensitive" data is hidden from users. For example: In the program DemoEncap class is encapsulated because the variables are declared as private. To access these private variables I need to use Name and Age accessors which contain the get and set method to retrieve and set the values of private fields. Accessors are defined as public so that they can access in other classes. → Page | 3
2.4. Polymorphism Polymorphism is the ability of any data to be processed in more than one form and it occurs when we have many classes that are related to each other by inheritance. For example: I created a class called Animal that has a method called animalSound(). Derived classes of Animals could be Pigs, Cats, Dogs, Birds - These also have implementation of an animal sound (the pig oinks, and the cat meows, etc.) In C# we can used Inherit using “:”symbol Finally I create Pig and Dog objects and call the animalSound() method on both of them which have the output: → Page | 5
2.5. Inheritance In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object (prototype-based inheritance) or class (class- based inheritance), retaining a similar implementation. Also defined as deriving new classes (sub classes) from existing ones such as super class or base class and then forming them into a hierarchy of classes. In most class- based object-oriented languages, an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object" , with the exception of: constructors, destructors, overloaded operators and friend functions of the base class. For example: In C# the child class can inherit the parent class by using ‘: ‘. In my program, the “Car” class(child) inherit the fields and methods from the “Vehicle” class(parent) → Page | 6
3.4. Inheritances Inheritance defines an "is-a" relationship between the parent and derived classes. For example , consider a class hierarchy of animals, where each animal has common attributes such as a name, age and weight, and methods such as eat() and sleep(). We can define a parent class Animal and derive child classes, such as Dog, Cat, and Monkey, each with their own unique characteristics and behaviors. Page | 8
I have been tasked with developing a system for small bookstores that sell education books, comic books and some basic stuff. The store has limited staff, with one owner and five employees, and relies on customer transactions heavily. During the interview with the owner and the staff there have been several key requirements and challenge identified: ● The owner wants to know the performance of the store and have access to the functionality for managing inventory, financials, and staff roles. ● The staff wants the functionality to manage payment processing so they have ease in running the system. ● The customers want an easy-to-use interface that is visually appealing and payment processing options that are secure.
Based on these requirements and challenges, I generate a list of requirements for the system: ● The system should have a user management system with roles for the owner, staff, and customers. ● The system should have an inventory management system for managing the store's products, stock levels. ● The system should have a sales management system to track sales, generate sales reports and payment processing options must be easy and fast. ● The system should have a customer management system that allows the store's employees to manage customer contact information and purchase history. ● The system should have an easy-to-use interface that is responsive and integrates with various payment gateways. ● Security of the transactions and the customer's data is of the utmost importance and should be ensured. Page | 9
3. Class diagrams Explanation: In this diagrams, there are 5 diagrams in total: ‘StoreOwner’, ‘Staff’, ‘Store’, ‘Customer’ and ‘Book’ , each one represent their own attributes and methods ‘StoreOwne’represents the store owner, who has a unique identifier ‘ownerId’, a name, and email. The ‘StoreOwner’ class has methods for adding, removing, and getting staff working in the store. The relationship between ‘StoreOwner’ and ‘Store’ is one-to-one, as each store has only one owner while each owner can own only one store. ‘Staff’ represents the staff at the store, who has a unique identifier StaffId, a name, and email. The Staff class has a method for updating their profile. The relationship between Staff and Store is also one-to-one, as each staff member works at only one store while each store has many staff members. ‘Store’ represents the store, which has a unique identifier storeId, a name, address.The relationship between ‘Store’ and ‘StoreOwner’ is one-to-one, as noted above. ‘Customer’ class has attributes such as ‘customerId’, ‘name’, ‘email’ and ‘cart’, representing the product(in our case-book) in the customer cart. The relationship between the customer and book product is many-to-many as a ‘customer’ could have multiple products in their cart, and a single ‘book’ could be in multiple customer’s carts Page | 11
4. Sequences diagrams 4.1. Adding Book to Cart In the first sequence diagram, a customer adds an item to their cart, and the system checks the inventory to ensure that the item is available. The store system then reports the availability to the customer, allowing them to proceed with the purchase. Page | 12