Its nice to know that we now have MVC of our own like rails. Asp.Net has best of features like " Rails " plus it adds more of its own and makes it more powerful. [:)]
We also have " Active Record " type support via SubSonic. Linq to SQL is also there, but i would like to go subsonic way.
I am planning to work with MVC to take full advantage of Rails and SubSonic to take full advantage of Active Record.
Can some one point me out a nice tutorial/blog on implementing this MVC with SubSonic.[Idea]
My Future plans are to work with IronRuby, DLR, Asp.Net and SubSonic It would be better, if start implementing right now. I can always convert the "Controllers" codes to IronRuby later on, while everything else remains the same even for the future.
Thanks
IronRubyMVCSubSonic
Paggy4u
-----------------------------------------
Working with Dynamic Languages
subsonic is an orm tool. similiar to linq to sql or linq to entity. if you look at any of the examples about asp.net mvc there are 3 parts (view... aspx, nvelocity, etc.) controlers (the heart of asp.net mvc) and the model (the model also includes the repositories)
so controlers are usually setup like this:
public class MyControler
{
private IMyRepository repository;
MyControler(IMyRepository repository)
{
this.repository = repository
}
}
IMyRepository is an interface, so how you implement it is up to you. your concrete implementation can reference subsonic.
public class MyRepository : IMyRepository
{
... code that references subsonic
}
you will need some form of dependency injection for this to work. either a full blown framework like spring.net, structure map, or castle windsor. or a simple "poor man's DI".
public class MyControler
{
private IMyRepository repository;
If you are not already subscribed, you will want to keep an eye on
Rob Conery's blog (creater of SubSonic for those who are not aware... and now part of Microsoft).
"MVC Support: We’re going to throw all kinds of love at the new MVC toolset. All Kinds. It’ll be magic. And we’ll cook up some nice reference apps for you to play with. More on that later (when I figure out just what features I’ll be
working on in the MVC toolset."
I have not seen any concrete tutorials put out yet - but I suspect his blog will be one of the first places to do so. In fact he put out a
teaser screencast of where he is headed with ASP.NET MVC a la SubSonic. (Download video direct from
here).
More detail is coming - right now I'm 75% or more on MVC and the MVC Toolkit. I do have a reference/inspiration app in the works, and based on my experiences there I'll be working up the new SubSonic MVC bits.
In terms of SubSonic and MVC (as it is now), you can literally just drop SubSonic in the /bin, generate the bits like you've been doing (although you can't use the BuildProvider).
I would add that the support for existing IoC containers to create Controllers and supply them the dependencies they need is being introduced in the
MVCContrib project.
paggy4u
Contributor
3017 Points
774 Posts
Asp.Net MVC with SubSonic Support.....?
Dec 10, 2007 05:40 AM|LINK
Hi,
Its nice to know that we now have MVC of our own like rails. Asp.Net has best of features like " Rails " plus it adds more of its own and makes it more powerful. [:)]
We also have " Active Record " type support via SubSonic. Linq to SQL is also there, but i would like to go subsonic way.
I am planning to work with MVC to take full advantage of Rails and SubSonic to take full advantage of Active Record.
Can some one point me out a nice tutorial/blog on implementing this MVC with SubSonic.[Idea]
My Future plans are to work with IronRuby, DLR, Asp.Net and SubSonic It would be better, if start implementing right now. I can always convert the "Controllers" codes to IronRuby later on, while everything else remains the same even for the future.
Thanks
IronRuby MVC SubSonic
-----------------------------------------
Working with Dynamic Languages
jason_m
Member
283 Points
81 Posts
Re: Asp.Net MVC with SubSonic Support.....?
Dec 10, 2007 12:15 PM|LINK
subsonic is an orm tool. similiar to linq to sql or linq to entity. if you look at any of the examples about asp.net mvc there are 3 parts (view... aspx, nvelocity, etc.) controlers (the heart of asp.net mvc) and the model (the model also includes the repositories) so controlers are usually setup like this:
public class MyControler
{
private IMyRepository repository;
MyControler(IMyRepository repository)
{
this.repository = repository
}
}
IMyRepository is an interface, so how you implement it is up to you. your concrete implementation can reference subsonic.
public class MyRepository : IMyRepository
{
... code that references subsonic
}
you will need some form of dependency injection for this to work. either a full blown framework like spring.net, structure map, or castle windsor. or a simple "poor man's DI".
public class MyControler
{
private IMyRepository repository;
MyControler()
: this(new MyRepository())
{
}
MyControler(IMyRepository repository)
{
this.repository = repository
}
}
Programmer
Specialty Bakers, Inc.
JamesSteele
Member
224 Points
34 Posts
Re: Asp.Net MVC with SubSonic Support.....?
Dec 10, 2007 12:43 PM|LINK
Hi paggy4u,
If you are not already subscribed, you will want to keep an eye on Rob Conery's blog (creater of SubSonic for those who are not aware... and now part of Microsoft).
Here is a comment he made on this blog post:
I have not seen any concrete tutorials put out yet - but I suspect his blog will be one of the first places to do so. In fact he put out a teaser screencast of where he is headed with ASP.NET MVC a la SubSonic. (Download video direct from here).
robconery
Participant
852 Points
195 Posts
Re: Asp.Net MVC with SubSonic Support.....?
Dec 10, 2007 05:49 PM|LINK
More detail is coming - right now I'm 75% or more on MVC and the MVC Toolkit. I do have a reference/inspiration app in the works, and based on my experiences there I'll be working up the new SubSonic MVC bits.
In terms of SubSonic and MVC (as it is now), you can literally just drop SubSonic in the /bin, generate the bits like you've been doing (although you can't use the BuildProvider).
simone_b
Member
295 Points
69 Posts
Re: Asp.Net MVC with SubSonic Support.....?
Dec 10, 2007 09:17 PM|LINK
I would add that the support for existing IoC containers to create Controllers and supply them the dependencies they need is being introduced in the MVCContrib project.