D For A Web Developer

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 02:41:35 PDT 2014


On Wednesday, 30 April 2014 at 04:21:20 UTC, Rikki Cattermole 
wrote:
>> Having a quick look at Cmsed I must admit I like plain vibe.d 
>> much more despite the added features :( Forced module coupling 
>> and OO-heavy design is big loss compared to design simplicity 
>> and independence of base vibe.d modules.
>>
>> For example I can't imagine a single case when I'd prefer 
>> class-based route definition to stock delegate-based.
>
> The classes are unfortunately just a container for routes. So 
> if you got a better way, that can provide the same 
> functionality, I'd love for a plan on how to do it!
>
> Basically my idea is that you register as little as possible. 
> That was why I went with a class for routes.
>
> I'm really gunning for less, simpler = more. And for 
> medium-large sites thats kinda important.

Why can't stand-alone annotated function be a valid route? Route 
is pretty much method + url + handler and first two can be 
inferred by convention in many cases (as done in vibe.web.rest & 
Co).

Right now your approach actually results in more code than stock 
vibe.d (stand-alone function + explicit route registration).


More information about the Digitalmars-d mailing list