Soon i will be starting to work on a small to medium web project. I will be the only developer to work on this project. So i am looking for pointers towards some design decisions/tools/technology. I would like to use asp.net MVC for this web project (the reason being this project has got good chance to grow a lot, therefore thinking more maintainable).
We use oracle as our backend and configured enterprise application data access block to use with odp.net and seems to have worked well. But all of our previous projects were typically asp.net web forms/windows forms.
So with mvc, is it better to use ORM like nhibernate than DAAB?
I have gone through this article, but still confused.. Thanks
Related
I have been checking resources to implement authentication in my web forms application built with entity framework. All examples I found are MVC-related. I have used regular Asp.Net Membership framework a long time before I began to use EF. However, I could not find Membership implementation with Entity Framework code-first. I did implement the Claims-Based Identity (EF created the tables for me in DB) but I do not know how to utilize it in the application (like login), and it looks more complicated to me. Can anyone guide me ?
There are a couple of good tutorials on the asp.net web site:
http://www.asp.net/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project
http://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/membership-and-administration
does anyone have good links or tips on best practices concerning migrating from ASP.NET Webforms to ASP.NET MVC?
We have a large webforms application that we would like to piece by piece migrate to MVC. Here is our current setup.
Two big Webforms project (VB)
Multiple class libraries and services (C# and VB.Net)
Subsonic 2.2 Data access layer
SQL Server 2008 DB
We are considering the following:
Keep the classic webforms project running as is for now while developing.
Create new MVC project based on MVC 3 with Razor view engine
Use Nhibernate (Repository pattern) DAL
Convert/build the existing functionality module by module in the MVC project
Replace some functionality in the old webforms project with new MVC modules if possible. Integrate via eg. Iframes.
In time the new MVC app will replace the old webforms project entirely.
We would like to keep the DB as is so we also need a tool to create the Model based on the DB.
Is this a possible solution?
WebForms applications use server-side session a lot because most of the server controls use it internally. You will not be able to use any of the server controls that you used in WebForms in MVC3 (atleast without some tinkering).
MVC3 promotes the use of restful architecture, where any state is maintained in html or url or cookies, and these are reasons why I think you should revisit the decision to convert to MVC3. Do so only if it will give you a huge advantage, because I suspect you will be reinventing ground up your existing app - I suspect there will be an equal amount of effort migrating it as to while developing it new.
Again there is nothing preventing you from creating an "area" or a "region" of MVC in your webforms app, if your goal is to use MVC for future development.
If you still want to move to MVC3, take a look here
It is ok solution. Also for NHibernate you can use MyGeneration with NH plugin to generate models on top of existing DB. And it is also possible to host WebForms and MVC together in one web app. Just finished quite the same task. But used EF for DAL.
I'm starting work on a Custom Membership provider and I was wondering which option would be the best to develop this application in Linq or Entity Framework?
Also I have a need to link two table from different database via a common ID and I was wondering does anyone know of any good tutorials about creating a MVC 3 Web Application that uses either Linq or Entity Framework to do this.
From my research Entity Framework seems to be the best method suited to my situation but I would appreciate some advice / confirmation that this correct and a little direction to a tutorial is possible?
By Linq, you mean Linq to SQL vs. Entity framework? If so, then I would recommend using Entity Framework. Microsoft's development on Linq to SQL has virtually stopped so EF has a better future.
NerdDinner is one of the more popular tutorial applications that uses ASP MVC 2 and entity framework. ASP MVC 2 is similar enough to get started with the basic concepts. Here is a good walk through tutorial:
http://nerddinnerbook.s3.amazonaws.com/Intro.htm
The code itself is freely available:
http://nerddinner.codeplex.com/
I am going to start new MVC 3.0 .NET 4.0 application.
I want to implement each component for my web site once and simply reuse it then for another web sites i going to build.
Currently i am looking the best practice i can use to achieve my goal.
I did some research and found that I may get a lot of advantages using MEF.
I found interesting MEF MVC solution called plugable MVC http://www.thegecko.org/index.php/2010/06/pluggable-mvc-2-0-using-mef-and-strongly-typed-views.
Is it really worth to use such kind of approach(Plugabble MVC) of building MVC apps?
Advantages disadvantages of pluggable MVC?
May be somebody may suggest something else?
What specific problem are you trying to solve? MVC is a very extensible and pluggable framework as it is. I would say that for a simple site MEF is not necessary. Please provide more information on the issues you are running into with the stock MVC framework.
In the future I will be working with MVC with java/j2ee,hibernate,and more, but for now I have asp.net, php, python, ruby, etc. If I learn how to use MVC asp.net or MVC with a php framework, or RoR, will that help me with the Java version? I don't want to wait until I start the java project before I start really learning how to use MVC, but if the .net or php versions of mvc are so different that it will be a major relearning, then I might not use the non-java mvc frameworks.
In short, is learning MVC on one platform good for learning it on all platforms? I realize the tools and languages will be different, but my question is for general knowledge.
I hate working on things in a "special" way for a one time project that will show no future benefit.
Thank you.
MVC is all about splitting your application into 3 major parts. The model which contains most of the code that interacts with your database, the controller which accesses the model and gets the data it needs which then gets passed to the view which renders this for the user to see.
No matter which technology/framework you choose this basic principle will remain and only the technology used behind it will change.
For example if you went the PHP route and choose symfony as your web framework you would be using Doctrine or Propel as your model/ORM. If you used JBoss Seam you would be using Hibernate/JPA as your ORM and EJBs as your controllers.
Even though these 2 frameworks follow the same rules when it comes to separating logic from design they also require you to learn very different concepts to utilize them correctly.
For instance in JBoss Seam, the framework relies heavily on your knowledge of scope and stateless and stateful session beans where in symfony there is no such concept (sort of).
So whatever route you choose, there is still much to learn after you've mastered the concept of MVC.
MVC is a basic software architectural pattern. It's just an abstract concept. Its specific implementations will differ based on the language and platform you are using (as does everything), but the basic concepts remain the same.
So in a word: yes. Learn what MVC means as a concept and you'll be able to transfer that knowledge between platforms and technologies.