Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uso de Patrones de diseño #20

Open
steevenGD opened this issue Dec 16, 2023 · 1 comment
Open

Uso de Patrones de diseño #20

steevenGD opened this issue Dec 16, 2023 · 1 comment

Comments

@steevenGD
Copy link

Buenos días/tardes/noches
Se ha encontrado una posible aplicación para el manejo de las familias de objeto relacionados a la clase Person, haciendo uso del patron de diseño Abstract Facthory se puede mejorar la instanciación de los objetos relacionados a la clase Person(Familias de objetos) , tales como Borrower o Staff con el uso de interfaces, espero les ayudo al mejoramiento de su proyecto.
Adjunto diagrama UML
image

@Mayuri1825
Copy link

Mayuri1825 commented Feb 7, 2024

I created an interface name PersonFactory and in that two methods were decalred createborrower() and createStaff().
createBorrower creates and returns instance of Borrower.
createStaff creates and returns instance of staffClass.
Also implemented interface in bowwer.java and staff.java classes.

createBorrower () in borrower class prompts user for borrower information(ID,Name,Address,Phone No) and then created a new instance of borrower

createStaff() in staff prompts user for staff information (ID, Name, Address, Phone number, Salary) and creates new instance of staff with these values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants