100% found this document useful (1 vote)
587 views

03 Laboratory Exercise 1 Application Development PDF

This document discusses several object-oriented design principles: - The Single Responsibility Principle is violated when a book class contains a method for a different function. - The Open-Closed Principle is violated because the book class needs modification for new types of book discounts. - The Liskov Substitution Principle is violated because a book order subclass could have a negative effect from shipping fees. - The Interface Segregation Principle is followed by splitting review and rating methods into separate interfaces for printed and audio books. - The Dependency Inversion Principle is followed by creating a BookManagement class that depends on a Book interface rather than concrete classes.

Uploaded by

mik mik
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
100% found this document useful (1 vote)
587 views

03 Laboratory Exercise 1 Application Development PDF

This document discusses several object-oriented design principles: - The Single Responsibility Principle is violated when a book class contains a method for a different function. - The Open-Closed Principle is violated because the book class needs modification for new types of book discounts. - The Liskov Substitution Principle is violated because a book order subclass could have a negative effect from shipping fees. - The Interface Segregation Principle is followed by splitting review and rating methods into separate interfaces for printed and audio books. - The Dependency Inversion Principle is followed by creating a BookManagement class that depends on a Book interface rather than concrete classes.

Uploaded by

mik mik
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
You are on page 1/ 3

03 Laboratory Exercise 1

Application Development And Emerging Technologies

Jarl Renzo Rey O. Naguit, Nori Niko Yamamura, Cresalyn DelaCruz, Rosalie Bacolinao

-Single Responsibility Principle (SRP)

-The violation for single responsibility principle is that book class contains another method, that does a
different function this violates the principles as it only allow one reason to change. our solution is to
create another class that contains that method that does that function. this way it has its only function
that others class can instantiate and use

-Open-Closed Principle (OCP)

-This class violate the OCP because, books need to modified. It should be extended for a new type of
class every book discount.

This study source was downloaded by 100000855152935 from CourseHero.com on 10-19-2022 20:20:34 GMT -05:00

https://www.coursehero.com/file/116051076/03-Laboratory-Exercise-1-Application-Developmentpdf/
-Liskov Substitution Principle (LSP)

-This class violate the LSP because, the subclass can’t be substituted to the base class, since shipping fee
can cause negative effect to BookOrder.

-Interface Substitution Principle (ISP)

-In this Principle as you can see I’ve split the seeBookReview():void and displayBookRate():void to the
printed book action same as the audiobookaction. I’ve made a new User interface which is
PrintedBookUI and AudioBookUI in where with this design only audiobook user interface and
printedbook user interface will only have access to printedbookaction and audiobookaction and if the
interface IBookAction can choose between audiobookaction where if the user wants to hear the
playbookaudio or printedbookaction to display the book rate.

This study source was downloaded by 100000855152935 from CourseHero.com on 10-19-2022 20:20:34 GMT -05:00

https://www.coursehero.com/file/116051076/03-Laboratory-Exercise-1-Application-Developmentpdf/
-Dependency Inversion Principle (DIP)

-In this principle I separated the updatecookbookshelf and updatehistorybookshelf and made a new
class which is BookManagement that can only use the book interface if the book manager wants to
change the price and then it will be updated to all the cookbook and historybook if the manager change
the book price and the manager can sold the book. In conclusion the high-level class is the
BookManagement and the low-level classes is updatecookbookshelf and updatehistorybookshelf which
it depend on the same abstraction, which is the Book interface.

This study source was downloaded by 100000855152935 from CourseHero.com on 10-19-2022 20:20:34 GMT -05:00

https://www.coursehero.com/file/116051076/03-Laboratory-Exercise-1-Application-Developmentpdf/
Powered by TCPDF (www.tcpdf.org)

You might also like