Comments (9)
I'm going to make it Dry::View
.
from dry-view.
Does it sound too ugly
Dry::View::View
?
Yes this would be horrible π
from dry-view.
Does it sound too ugly
Dry::View::View
?Yes this would be horrible
Hahaha... well, I disagree π
from dry-view.
@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.
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.
@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.
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.
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.
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)
- Prepend and then modify only a single decorated attributes module
- Allow access to the current `format` somehow
- Create dry-view-rails integration gem HOT 2
- Remove some senseless paths from partial lookup
- stack level too deep (SystemStackError) when using layout HOT 5
- Path name in error message printed as stringified class
- Template isn't reloaded until rack app is restarted. HOT 6
- Reloadable templates HOT 4
- ArgumentError: wrong number of arguments (given 3, expected 1..2) HOT 16
- part configuration HOT 1
- Deprecation warnings from dry-configurable HOT 3
- Status of Dry View with Hanami View in mind? Will this be deprecated/archived? HOT 1
- Revisit the renderer subsystem
- Rename "context" setting to "default_context"
- Switch to non-block form for configuration
- Configurable part builder extensions?
- Add option to prevent exposure values from being decorated with parts
- Add option to make exposure available to layout
- Improve performance HOT 4
- Use prepended module for decorated attributes in Part
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dry-view.