GithubHelp home page GithubHelp logo

Comments (3)

philsturgeon avatar philsturgeon commented on September 17, 2024

Without being an abstract, this just wont work at all.

This to me is a lot like Controllers. You can make your own BaseController by extending Controller.

FooTransformer > BaseTransformer > TransformerAbstract.

I dont think this needs to change; If people want to implement traits or interfaces or extra layers of whatever they can just do that.

from fractal.

benglass avatar benglass commented on September 17, 2024

I am not suggesting getting rid of the abstract transformer. I was just suggesting providing a TransformerInterface in addition which could be used in cases where you dont want to extend the abstract transformer (for example if your logic is completely different for how to perform the transformation).

The current setup works perfectly fine and the main reason I suggested this is that when I was reading the code I looked for a TransformerInterface to try to understand the relationship between the components and didn't find one.

This is obviously not a necessary update in any way, I just think it would add a little flexibility and possibly some conceptual clarity to newcomers. Feel free to close this issue if your not interested in this update, otherwise Id be happy to submit a PR.

Anyway nice work on this package, I used it last night for a simple API and it was very easy to understand by comparison to some of the other existing serialization solutions available for php which you might use for this purpose and I like the code over configuration approach.

from fractal.

philsturgeon avatar philsturgeon commented on September 17, 2024

Thank you :)

I am not suggesting getting rid of the abstract transformer. I was just suggesting providing a TransformerInterface in addition which could be used in cases where you dont want to extend the abstract transformer (for example if your logic is completely different for how to perform the transformation).

I see what you mean. I know you dont mean to remove it, but not using it is just as much of a problem. It could be that I could refactor code to take things out of the transformer and make things work some other way, but right now I cannot possibly see how anything would work without the Abstract being used. Trying to define what the methods should do in the interface would be a very wordy and complex task, and I am not sure I understand the benefits, or even how I would go about doing it.

Do you mind if I go the "PR or STFU" route on this one? Or just ask you to shove some examples in here? I'll be happy to talk about it more if you can piece of code me, but right now im not sure of the benefits, can only see downsides and dont really understand the use-case. :)

from fractal.

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.