Code Monkey home page Code Monkey logo

Comments (3)

XedinUnknown avatar XedinUnknown commented on May 22, 2024 1

Thing is, you can't always use decoration to change behaviour in a meaningful way, without re-implementing. In a perfect world, that would be great. But we don't write perfect code, and therefore I feel it is unfair to prevent users from adapting code to their needs. Also, and this is my opinion, making things explicitly final violates OCP.

from psr7.

mahagr avatar mahagr commented on May 22, 2024

You should use decorators instead of extending the classes:

https://github.com/getgrav/grav/tree/develop/system/src/Grav/Framework/Psr7/Traits
https://github.com/getgrav/grav/tree/develop/system/src/Grav/Framework/Psr7 (ignore AbstractUri, it's deprecated)

from psr7.

Nyholm avatar Nyholm commented on May 22, 2024

These are excellent questions. This has been discussed in lengths at #31.

I know that this library is forcing people to write good code and not to be lazy. I know that it is frustrating. I have not yet seen an argument based on computer science that show that the classes should not be final.

Also, and this is my opinion, making things explicitly final violates OCP.

I see that this is your opinion. But that opinion has no support in the definition of polymorphic open-closed principle. =)

You have to consider the "module" to be the PSR-7 specification together with this implementation.

from psr7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.