I don't think specifying the layout files beforehand is a good way to
go. This would eliminate the possibility of doing things like
dynamically selecting a layout file from the controller (as a way of
implementing skinning on a site for instance).
I think it would make more sense to have the layout view generate a
separate class from the view that is using it. That way, it wouldn't
be an issue to dynamically mix and match them after they are compiled.
Also, as a personal preference, I would want the views compiled into a
separate assembly rather than have the CS files generated and become
part of the project.
On Aug 4, 2:00 am, "Louis DeJardin" <
louis.dejar...@gmail.com> wrote:
> Yeah, that would be ideal. I believe pre-generating all of the view cs
> files is something nhaml does as well.
>
> But the big question is how do you know what set of view/master
> combinations need to be generated? You could have an inventory xml
> file list them all, but that seems out of step with "don't repeat
> yourself".
>
> Though maybe that could just be the nature of the thing. You have to
> name what you want to precompile.
>
> Or instead of an inventory xml file maybe the spark view files could
> have a <precompile master="blah"/> element? That way you could spin
> through all of the files on startup.
>
> After that you could have a compile-time tool that generates the all
> of the view cs files to include in the web project. Or would it be
> better to compile a different assembly to contain all of the view
> classes rather than assuming they'll be compiled directly into the web
> app?
>