at DJ Alexander • Working in web application development since 13+ years. • Twitter: @kapilsharmainfo • Facebook: /kapilsharmainfo • Linked in: kapilsharmainfo • Website: kapilsharma.info • Slides: speakerdeck.com/kapilsharma 2
India. • Conducts regular meet ups • meetup.com/phpreboot • phpreboot.com • Twitter: @phpreboot • Facebook: /PHReboot • Slack: phpreboot.signup.team • Youtube: www.youtube.com/channel/ UCbLir8nYAFJ5YpcbjEFzjVw 3 Please subscribe, so that we can get custom Channel URL like youtube.com/phpreboot (Need 100 subscribers to get custom URL) Sponsored by JetBrains (IDE License) DJ Alexander (Space and snacks) Ansh Systems (Space and snacks)
to extend A class should have a single responsibility. Statement A class should have only one reason to change. UNIX Principle Do one thing and do it well.
extend Open for Extension Statement Close for modification Detailed Example (previous meet up of the series) https://www.youtube.com/watch?v=uVJtkgEr5Sk
to extend Objects of sub-class must be able to replace object of parent class, without impacting program Statement Child class should never replace functionality of parent.
to extend No client should be forced to depend on methods it do not use. Statement Many client specific interface are better than one general purpose interface How?
to extend Low level classes (concrete functionality) needed by high level classes (Business logic) What is Dependency? Register -> send registration mail High Level Low Level <<depends>> Mailer Register -> Save data ORM/PDO
to extend High level module should not depend on low level module Statement Both should depend on Abstraction Abstraction should not depend one details Details should depends on Abstraction
level module should not depend on low level module Both should depend on Abstraction Abstraction should not depend one details Details should depends on Abstraction