I would still like to learn what my mistake was with the delegates. However, I've come back around to one of my original solutions. I removed it from the table early on, but after exploring other options, I like how this looks and how it works.
source/views/user.d:
module bolt.views.user;
class UserViews {
protected void register(HTTPServerRequest req, HTTPServerResponse res)
{
bks.addUser(req.form);
res.render!("user/register.dt", req);
}
bolt.d:
module bolt.bolt;
import bolt.views.user;
class Bolt {
private {
auto USER = new UserViews;
bks = new CassaClient("127.0.0.1", 9042, "bolt");
}
...
void register(URLRouter router) {
router.get("register", $USER.register);
}
}
If anyone has a critique of this method of organisation, I'd like to hear it.