assignment final advanced programming, Assignments of Business English

afffâfâfăfăfawfawfawfawfawfawfawfawfawaawfawfawfawfawwfawfawf

Typology: Assignments

2020/2021

Uploaded on 01/03/2021

nguyen-lam-thang-fgw-hn
nguyen-lam-thang-fgw-hn 🇻🇳

5

(5)

1 document

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 20: Advanced Programming
Submission date
Date Received 1st submission
Re-submission Date
Date Received 2nd submission
Student Name
Nguyễn Lâm Thắng
Student ID
GCH18545
Class
GCH0716
Assessor name
Doan Trung Tung
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P1
P2
M1
M2
D1
D2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download assignment final advanced programming and more Assignments Business English in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyễn Lâm Thắng Student ID GCH Class GCH0716 Assessor name Doan Trung Tung Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P1 P2 M1 M2 D1 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

I. Introduction

As an employee in a software development company, to help improve their documentation of their in-houses software libraries which were developed with very poor documentation, I alleviate this situation by showing the efficient of UML diagrams in OOAD and Design Patterns in usages. The detail of them will be shown in the report.

II. OOP general concepts

Definition : Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This approach to programming is well-suited for programs that are large, complex and actively updated or maintained. The organization of an object-oriented program also makes the method beneficial to collaborative development, where projects are divided into groups. Additional benefits of OOP include code reusability, scalability and efficiency. Even when using microservices, developers should continue to apply the principles of OOP. Principles of OOP: Object-oriented programming is based on the following principles:

  • Encapsulation.
  • Abstraction.
  • Inheritance.
  • Polymorphism. (Rouse)

III. OOP Scenario

1. Scenario The Apollo english center - A center teaches Toeic, Ielts, Toefl…. for everyone. Now, the center wants to expand the system because there are more people want to register day by day. Moreover, the old system was out of date. This system makes difficult in managing everything. Therefore, to help the center manage the

information of teachers and students better. I create a system to do it. In the system, there are 3 main actors : Admin, Teacher and Student. Each actor has the corresponding functions.

2. Use case Diagram Based on the scenario, I have use case diagram for 3 main actors: Figure 1 : Use case Diagram Admin has functions :

  • See detail of class
  • Recruit Teacher
  • Recruit Student
  • Create Class
  • Fire teacher
  • Fire student
  • See syllabus

Student. These classes are inheritance from superclass Person. This superclass has the same attributes. Relationship between Person class and Admin , Teacher , Student class is generalization In addition, Admin class also has attributes: Authorities and ID. Teacher class also has attribute: Syllabus. Student class also has attribute: Review Relationship between Admin class and Authority class is Association. Each Admin has an unique ID and functions: add more teacher, student or delete teacher, student. Relationship between Teacher class and Syllabus class is Association. Each Student has an unique ID and can review the class. Relationship between Student class and Review class is Association. Each Teacher has an unique ID and can create syllabus for the class.

Because Student , Teacher , Admin classes are inheritance from Person superclass , these classes can see information of NewsBoard through class NewsBoard. So relationship between Person class and Newsboard class is Association. This class is created for showing all information of class. Relationship between Newsboard class and Information class is Aggregation. In that, information is taken from class Information and class Address. Relationship between Information class and Address class is Aggregation, too. From 2 classes above, I can get ID to see information. Each class has attributes and methods as above. Relationship between Person class and Course class is Association through attribute SS1. As the same, relationship between Course class and Level class is Association. Moreover, Relationship between Level class and Bill class is Aggregation. At the Course class, there is a function for student test to get mark. This mark is used for studying suitable and student can pay fee.

Figure 3 : Class diagram for DP ( Singleton ) There will be 3 main classes: ComputerSystem, Computer and Table.  Class ComputerSystem (Singleton) : In the class ComputerSystem , the private will create a " cs " pointer that will be the only object of both a system and must be static. Besides creating a " Table " vector to store besides, we also have the Constructor ComputerSystem () function. Coming to the public function, there will be ComputerSystem * get_computer_system () in the static form to transfer data and will call vector get_tables () along with functions such as adding tables ( add_table ) or adding rations ( add_ration )  Class Table: Coming to the class Table. To facilitate the calculation with name calling. Here private will pass Name as string and vector rations as string, to public will have functions with properties similar to ComputerSystem class but will have an invoice () function to be able to print invoices when you need to create a menu.

Class Computer: Finally, the class Computer will be connected to the class ComputerSystem through the Association relationship, so that we can use and name the other functions like creating a new invoice create_invoice () or print the invoice with the invoice () function. Relationship:

- ComputerSystem: Because this is a Singleton pattern, there will be relationships with an Association with the ComputerSystem function itself to represent Singleton.

  • Class Table with the class ComputerSystem will have an Aggregation relationship
  • Class Computer will be connected to the class ComputerSystem through the Association relationship 2. Structural pattern In Software Engineering, Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities.
    • Adapter: Match interfaces of different classes
    • Bridge: Separates an object's interface from its implementation
    • Composite : A tree structure of simple and composite objects
    • Decorator: Add responsibilities to objects dynamically
    • Façade: A single class that represents an entire subsystem
    • Flyweight: A fine-grained instance used for efficient sharing
    • Private Class Data: Restricts accessor/mutator access
    • Proxy: An object representing another object a. Apply in scenario 1 : Scenario : There is a Toeic teaching center (Center A) preparing to incorporated into an IELTS teaching center (Center B). Initially, the center B will check the learning process of the students at Center A to arrange the appropriate class at Center B. To do it quickly, I will create an adapter pattern to convert the Student information at center A (including the conversion of TOEIC score - > IELTS) to center B. Class Diagram :
  • getPhoneNumber: string : get phone number of student ( return type string ) ConversionAdapter:
  • getGrade() : double : get grade of student ( return type double )
  • getName(): string: get name of student ( return type string )
  • getID() : string: get ID of student ( return type ID )
  • getPhoneNumber: string : get phone number of student ( return type string ) Moreover, each class has default constructor and construct has paramaters. b. Apply in scenario 2 : Apply the Creational Pattern Composite: Scenario: Title: Staff Management. Topic: Human resources department of a company X is having difficulty in managing personnel. They need a software to manage personnel information including division management and departmental personnel. Managers need information: ID, Name, position and the department they are operating. Personnel need information: ID, name, position, salary. The HR division can:
  • Add and remove managers.
  • Add, delete, update employee information.
  • Human resources statistics of the department.
  • Statistics of department managers. Class Diagram:

Figure 5 :Class diagram for DP ( Composite ) Explanation: The diagram consists of 3 classes equivalent to the components of the composite structure: Person (Component): has the common properties of Manage and Employee: Name, ID, Positon.  Being a representative class, it is possible to represent (abstractly) the other 2 classes  Contains general information of the other 2 opponents (manager and staff).  Contains common manipulation methods of object components. Employee (leaf): has an additional attribute: private: Salary.  Is the smallest unit, representing its employees  Employees cannot manage employees.  Operations in the Class Person can be used. Manage (Composite): Has more attributes: Department.  Represents an aggregate class because it can contain many (stores) Employee (leaf)  It is possible to create itself through the use of person (Component) class to create.  Operations in the Class Person can be used.

Relationship:

The relationship between Employee and Person is an inheritance relationship.

+Update(Id : string, name : string, Position : string, Salary : int) : Update information of employee +Showall() : void : Show information of all managers by rank +is_equal(f : company) : bool : Check employee or manager to delete person easier. +add_personnel(c : Person) : Add more people ( manager or employee ) +delete_personnel(c : Person) : Delete people ( manager or employee )

3. Behavioral pattern In software engineering, behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.

  • Chain of responsibility: A way of passing a request between a chain of objects
  • Command: Encapsulate a command request as an object
  • Interpreter: A way to include language elements in a program
  • Iterator: Sequentially access the elements of a collection
  • Mediator: Defines simplified communication between classes
  • Memento: Capture and restore an object's internal state
  • Null Object: Designed to act as a default value of an object
  • Observer: A way of notifying change to a number of classes
  • State: Alter an object's behavior when its state changes
  • Strategy: Encapsulates an algorithm inside a class
  • Template method: Defer the exact steps of an algorithm to a subclass
  • Visitor : Defines a new operation to a class without change (Sourcemaking) Apply in the scenario : Apply Chain of responsibility to the scenario: Scenario : school X wants to enroll. Browse student's transcript: (has 1 time)
  • Pretty test and score> 6.5 or good conduct and average score> 6.5: passed
  • Left to slip.

English test: (has second change)

  • Pass: majoring
  • Fail: learn english again. Specialized subject test: (has second change)
  • Pass: specialized class.
  • Fail: normal class Class diagram: Figure 7 : Class diagram for DP ( Chain of responsibility) Scenario based: there are 5 classes (Student class, Auditor class, AuditorSchoolProfile class, AuditorTestEnglish class, AuditorTestSpecialized class). Students Class : encapsulate data including: (name: string), (id: string), (round: int), (point: double). public has:
  • Default constructor (Students ()),
  • The constructor has the parameters: (Students (id: string, name: string, conduct: string, point: double, round: int)).
  • The function takes the data: name, conduct, point, round from the object (get_name (): string, get_conduct (): string, get_point (): double, get_round (): string).
  • The function increases round: pass_round (): void.
  • Data entry function of class: import (): void.

Sourcemaking. (n.d.). Retrieved from https://sourcemaking.com/design_patterns/behavioral_patterns