0% found this document useful (0 votes)
15 views10 pages

OOP Design for Car Rental System

This document presents the design of a solution to improve the management of a vehicle rental company called Car-Rent using object-oriented programming. It describes the analysis and design carried out, including the class diagram with the classes Rental, Vehicle, Client, and Return and their relationships. The objective is to develop a program that allows controlling the rented and returned vehicles through the validation of attributes and methods in each class.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

OOP Design for Car Rental System

This document presents the design of a solution to improve the management of a vehicle rental company called Car-Rent using object-oriented programming. It describes the analysis and design carried out, including the class diagram with the classes Rental, Vehicle, Client, and Return and their relationships. The objective is to develop a program that allows controlling the rented and returned vehicles through the validation of attributes and methods in each class.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ANDRÉS BELLO UNIVERSITY

ADVANCED PROGRAMMING

LEARNING GUIDE No. 1


P.O.O. CAR-RENT PROJECT

Author: Juan Núñez Estrada,


Degree: Computer Engineering and Computer Science - Online, Andrés Bello University

09 de Abril de 2022

1
INDEX

PROBLEM DESCRIPTION

ANALYSIS AND DESIGN OF THE SOLUTION

CONCLUSIONS

BIBLIOGRAPHY.......................................................................................................................10

2
1. INTRODUCTION

As we have already learned in class, we know that Object-Oriented Programming


(OOP) maintains fundamental pillars which are: abstraction, encapsulation,
inheritance and polymorphism, which also allows us to apply the different types of
relationships between classes, considering the communication mechanism that objects have
What is association, aggregation, and composition.

For the above reasons, in this work, we will apply the following considerations that we
they will help develop the proposed statement:
Class Diagram using OOP.
JAVA Programming Language.
Fundamental concepts of OOP.
Association, Composition, Aggregation, Inheritance, and Polymorphism.
Good Practices in OOP and Design.

Likewise, the objective of this work is to be able to design a solution for the company 'Car-'
"Rent," which allows, through Object-Oriented Programming, to develop a
program aimed at improving the management of the company.

For the above reasons, the structure of this report will include the following aspects:
Analysis and design of the solution.
Aspects and fundamentals of programming.
Conclusions.

3
DESCRIPTION OF THE PROBLEM

According to the request from the company Car-Rent, an automated system is required.
to improve the management of the company and make available the processes that are currently used for the
control of rental and return of vehicles.

Based on the client's request, the objective of this work is to design a program.
considering Object-Oriented Programming, which allows developing a solution related
with the implementation of a program that is capable of maintaining adequate control of the
vehicles that are rented and returned at the company.

For the above, the class diagram was developed, where the identified and managed
attributes, considering the following methods:

- Rental
- Vehicle
- Client
- Return

For the above, the following actions were taken:

UML Class Diagram


The corresponding UML class diagram was designed using the StarUML Application Version
4.1.6 (image 1.1), where the classes were graphed with their corresponding relationships (image
1.2):

(image 1.1)

4
(image 1.2)

2. Identification of Classes with their corresponding types of relationship.


In order to devise the best solution and manage each of its attributes and methods,
the following classes were created, with their corresponding methods:

Class Subclass Attributes Methods Observation


Rental -Number of Validate the rental
Lease considering:
Rental Date Assign number of
Number of days of rental.
rental. Validate what the
number of days of
rent shall be between 1
and 10 days.
Validate that the amount
del rent if
obtain from the
price that the user
enter considering
the number of days.
Vehicle Patent Validate the vehicle
Brand considering:
Model Length of characters of
Year 8-digit license plate.
Condition The year of manufacture
(available, it must be since 2000
leased to the present.
maintenance.) Validate the condition,

5
considering also
that when entering
a new vehicle
initially take the
condition of
available (D).
Client Name Validate customer entry
Rut considering:
Validity New entry
client.
Route to have a long one
of 10 digits with
penultimate digit a
script and last digit
with a value between 0 to
9 or a k.
Validate that the client
be current (true:
valid, false: no
valid.
Upon entering a new
client his condition
initial validity is
true
Return -Fecha Devolución Validate the return of the
considering:
Return date
cannot be less than
the rental date.
Add the book to the
- -

ANALYSIS AND DESIGN OF THE SOLUTION

Analyzed the requirement of the client Car-Rent and considering the purpose of the solution
proposed, the following Class diagram was developed:

6
Note: At the design level, it is possible to see that the relationship indicates that the "Loan" is
composed of "Vehicle" and "Client".

Based on the aforementioned diagram, the following fundamentals can be described:


1. Clase Cliente
In this class, we identify the Client Superclass which maintains a relationship of type
"added" with the Rental Class, which is a strong relationship, since, at the moment of
to finalize a vehicle rental, a customer who requests it is absolutely necessary and
lease.

7
2. Vehicle Class
The Vehicle Class also maintains an 'aggregated' relationship with the Class
Renting, which is a strong relationship, since, at the moment of completing a rental,
A vehicle is absolutely necessary to generate the rental.

3. Class Return
This class maintains a 'composed' type relationship with the Rental Class, which is a
very strong relationship, because it only exists if a rental is formalized, otherwise
news rental, it makes no sense that it exists since there is nothing to return.
It should be considered that when a lease is generated, the return date is created.
associated with the rental of the specific vehicle.

4. Rental Class
This class maintains a strong 'aggregated' relationship with the Vehicle and Customer Class.
If the vehicle or customer does not exist, the rental will not be finalized.
It also has a very strong 'composite' type relationship with the Class.
Return, since if a lease is not generated, there is no return date.

8
CONCLUSIONES

Once all attempts have been made to develop the best solutions to the issue
From the statement, the following can be inferred:

It is essential to have better guidance when starting to program through


of the Object-Oriented Programming paradigm, define the relationships that our
Class diagrams can have various types of objects, with the purpose that our
future program to implement can have the necessary instances defined that guarantee
the functionality and management that the client Car-Rent needs, aimed at avoiding problems with
inconsistencies and duplication of information.

Finally, based on our established objective, it can be concluded that the level of achievement
achieved is considered as "medium" since even though it is estimated that the design of classes
and their relationships are accurate, it was not possible to faithfully develop the functionality that the client

I needed the program.

For the above reasons, it is essential to continue with the training and resolution of
issues that contribute to optimal familiarization with O.O.P.

9
BIBLIOGRAPHY

Landero. P. (apunte UNAB - CHILE). Conceptos Pples. del Lenguaje de Programación.2021.

Landero. P. (apunte UNAB - CHILE). Fundamentos Paradigmas OO y Lenguajes POO.2021.

Landero. P. (UNAB - CHILE notes). Implementation of Relationships between Classes. 2021.

10

You might also like