Giter Site home page Giter Site logo

Reconsider terminology about dry-view HOT 9 CLOSED

dry-rb avatar dry-rb commented on May 22, 2024
Reconsider terminology

from dry-view.

Comments (9)

timriley avatar timriley commented on May 22, 2024 4

I'm going to make it Dry::View.

from dry-view.

solnic avatar solnic commented on May 22, 2024 1

Does it sound too ugly Dry::View::View?

Yes this would be horrible πŸ˜†

from dry-view.

waiting-for-dev avatar waiting-for-dev commented on May 22, 2024 1

Does it sound too ugly Dry::View::View?

Yes this would be horrible

Hahaha... well, I disagree πŸ˜„

from dry-view.

timriley avatar timriley commented on May 22, 2024

@jodosha @AlfonsoUceda here's a run through of our current terminology for you.

The most unusual of these, as you've noted, are "controller" and "part".

I feel "controller" is actually appropriate since its job is to coordinate multiple parts of the application to prepare the data for the template. It's not really the "view" on its own, since the "view" is the combined effect of a controller and the rendering of its templates (even though within an application development context I do tend to refer to the controller classes as "views").

As for "part", I suppose you could replace it with "presenter" or "decorator", but I feel the difference in terminology here is actually helpful, as a hint that parts operate a little differently to what we've seen branded as presenters or decorators elsewhere in the Ruby ecosystem (i.e. parts have access to almost the entirety of the view rendering environment, which is part of the key value proposition for dry-view).

The other thing I like about the term "part" is how well it fits with its neighbouring concepts: part, scope, context. They're all very strongly noun-like terms, which is appropriate, since these objects are all initialized with values as state. On the other side, we have the more verb-made-noun terms, like controller, part builder, scope builder, which are functional objects, initialized with config only, with the values passing through #call. I know this is a subtle differentiation, but I made it consciously, and I do think it helps.

Anyway, if we want to tweak any naming, now is the time. Happy to continue the discussion here or elsewhere.

from dry-view.

timriley avatar timriley commented on May 22, 2024

Hi again @jodosha @AlfonsoUceda, I'd love to close this off by the end of the week. Could you please consider this and let me know if you have any thoughts? Like I explained above, I'm pretty happy with the overall naming arrangement, but if there was ever a time to contemplate any changes, it is now :)

from dry-view.

jodosha avatar jodosha commented on May 22, 2024

@timriley Thanks for putting this together. This glossary will be extremely useful both internally and for final devs (guides).

I agree to having part to differentiate "take the distance" from concepts like presenters and decorators, but I don't think it's the case for controller. IMO that is a view, and should be named so.

Also, having controller as term in view layer (as V of MVC), it's counter-intuitive.

from dry-view.

timriley avatar timriley commented on May 22, 2024

Thanks for your feedback, @jodosha :)

After thinking it through some more, I think a rename of Controller to something else would indeed be beneficial to this project and users’ understanding of it.

Like you indicated, the most obvious renaming would be Dry::View::Controller => Dry::View, but we're taking a moment just to see if we can think of any better alternatives.

Do you have any other ideas?

from dry-view.

solnic avatar solnic commented on May 22, 2024

I tried to come up with a better name, but you're right - View is the best name for this class. The only downside is that it would become a namespace too, which I don't like because by inheriting from it your class will be "polluted" by other things from View namespace. Any ideas how this could be solved, or do you think it's not really a problem?

from dry-view.

waiting-for-dev avatar waiting-for-dev commented on May 22, 2024

Does it sound too ugly Dry::View::View? Dry::View is the namespace, and within there you have the View.

A middle way could be Dry::View::ViewController, but I also prefer just View for the MVC influences.

from dry-view.

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.