SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
715 stars 109 forks source link

Why is scope called "scope"? Why not "router" or "route"? #83

Closed rmunn closed 6 years ago

rmunn commented 6 years ago

The names application, pipeline, and controller all makes sense to me, and I intuitively grasp what their purpose is. But every time I want to write a router to connect URLs (or partial URLs) to handlers, I want to type let books = router { ... } instead of let books = scope { ... }.

So why is this CE builder called scope instead of router? I realize that Phoenix uses the name scope and Saturn was heavily inspired by Phoenix, but since this was confusing to me, there's a possibility that it would be confusing to someone else who'd never used Phoenix, and that router might be a less-confusing name. It's at least worth opening a discussion.

Krzysztof-Cieslak commented 6 years ago

So why is this CE builder called scope instead of router?

Well, the reason was literally because Phoenix call it like that. ;-)

However, I do agree that we maybe should rename it to router as it would be less confusing for people starting with the framework, and it would better express what this component is about.

CC: @isaacabraham @NinoFloris @baronfel any opinions?

isaacabraham commented 6 years ago

Router works for me. In our training course, that's exactly how we describe scope, so it seems like a good fit. Scope isn't necessarily bad - it represents a "scope" of routes :-) But router seems even better.

forki commented 6 years ago

+1 - and keep scope as deprecated for couple of minors

NinoFloris commented 6 years ago

Yes! Good change

Krzysztof-Cieslak commented 6 years ago

The funny thing is that I actually use name Router in the overview documentation ;-)

Ok, let's do this.

Krzysztof-Cieslak commented 6 years ago

Fixed by https://github.com/SaturnFramework/Saturn/commit/4f896ef906a569a3b2802bbd50cb0e6a6c73e41e