Simple MVC Framework for ASP.net? - c#

I need a simple MVC framework, without jQuery extensions, hibernate, loggers, etc..
Only Model-View-Controller functions. Anyone have an idea where I can find one?

Does the official ASP.Net MVC framework not meet your needs? It doesn't come with loggers, ORM's or anything like that. And it is extremely flexible and extensible.
Yes, by default it includes jQuery libraries in any new projects you start... but those are simple to remove, and are not part of the framework itself. There is no reliance on them.

If you don't need jquery, then simply delete it from your ASP.NET MVC project.
Two alternative MVC frameworks would be: Vici.MVC, FubuMVC

Other MVC frameworks that haven't been mentioned here:
MonoRail (2.0 was released today)
Bistro (great F# support)

http://asp.net/mvc is the only ASP.NET framework I know off. It's very basic out of the box, and it's up to you what you add to it.
It allows you to add to it whatever you need and doesn't force you to use anything except the MVC design pattern and ASP.NET.
It's very simple in that all you really need to worry about is Models, Views and Controllers.

I second on the Vici MVC framework! Open source, easy to setup, easy to learn, lightweight, powerfull and with a good support channel through a StackExchange-based webpage.
The Vici Project comes with a lot more libraries (e.g. Vici CoolStorage = ORM) which work beautifully together.

Go with ASP.NET MVC. That's about as simple as it comes. If that's too complex, I'd suggest regular webforms or MVC on a different platform (like CakePHP)

I've designed a minimalistic MVC framework for ASP.Net named BarelyMVC. It's BSD licensed and currently at an alpha release.
It gets it's name because it's quite literally barely an MVC framework. It attempts to take all of the magic out of the equation and lets you directly control many aspects of how things work. There are no magical attributes. It consists of a simple stateless authentication system, a statically compiled view system made using T4, and a powerful Router and set of classes for handling HTTP requests. When put together it can make for very clear and easy to read/write code that you know exactly what it does. It also takes a hands off approach to architecture. When something you write doesn't mesh well with the traditional MVC architecture, it's trivial to work around that.

Related

asp.net core 2.0 dotvvm vs razor pages - which one is more powerful for an interactive web app?

With the latest release of ASP.NET CORE version 2.0 we now have Razor Pages which I really like because it shows a MVVM way of developing which I am already familiar because I've used it in UWP.
I was searching to develop web apps without js because I am a .net developer and I came across this framework known as DOTVVM , it is great because it gives some features of js frameworks like Angular, React etc. and it also integrates very well with ASP.NET CORE 2.0
I want to discuss this between following 3 scenarios :
I should use DOTVVM and not use JS at all.
I should use Razor pages instead with asp.net core 2.0, because razor pages provide all functionality which dotvvm provides and it will have more community in future.
I should learn a JS framework like Angular or React because neither razor pages, nor dotvvm is powerful enough to replace them.
The discussion can be from point of view of all developers, so I can get opinion of JS developers as well as those who have worked with dotvvm or Razor pages. The aim is to create completely interactive and responsive web app with good performance.
**Important : ** the web app created can be a progressive web app from the start or maybe turned into a pwa after creating it, depends on the technology I choose at the end.
I know for a progressive web app I will need to write a little JS, but that is alright considering that is very simple and little to write.
The reason of this question is so that we can discuss these options from multiple perspectives and deduce a better option at the end for my app.
It really depends on the type of the application you are trying to create. The fact is that you can build any application in any web technology. The difference is only in how difficult it would be.
Razor Pages are very easy to use and they are part of ASP.NET Core platform. They are using the MVVM pattern, but they are not helping with client interactivity. If you need to hide some form field based on some condition, you would need to do it in JavaScript.
I would use them for a simple company website, very simple admin sites with few pages and trivial forms, or for a public facing part of some eCommerce site. I would probably use also jQuery or other libraries to do the interactivity, animations and things like that.
DotVVM is an MVVM framework which helps especially with web applications with complicated UI: lots of complex forms with dozens of fields and interactivity (when you select an item in a combobox, another combobox will get new values, some fields will be pre-filled, a part of the form will disappear or change and so on). Modal dialogs, multi-step wizards, lots of grids with data, sorting, paging...
Because DotVVM handles many things for you and translates the data-bindings to JavaScript, you don't need to write the JS yourself. It doesn't mean that you should not learn it. It will help you a lot if you know it - you will be able to add even more interactivity, extend the framework when you need it and more. DotVVM lets you do quite a lot without knowing JS, but you will get much further if you know it.
Angular, React or other client-side frameworks are used widely today and many websites and applications are built in that. They are more universal than DotVVM, which aims primarily at the business app segment and requires .NET on the server (because it is not only the client-side library).
Using Angular or React requires the knowledge of JavaScript, and not only that. You will need to know Node.js and the related tooling, like npm. You will need to exchange data with the server, so you will need to build probably a REST API, use Swagger to generate the client-side proxy classes, and then you will probably need some other JS libraries with controls and things like that.
It is quite a lot of things to learn and if you are used to the comfort of Visual Studio, like the IntelliSense or the debugger, you will miss these features for sure.
And finally, you don't need to stick to one technology. You can combine Razor Pages with DotVVM for example. You can make the admin dashboard in DotVVM and the public part of the website in Razor Pages.
Microsoft is coming back to the WebForms approach to simplify the project structure trusting in the "Convention over configuration" mantra, while hiding the configuration from developer to make things faster. But it has the disavantage that everything will be mixed again. I doesn't look like a smart move for organizing. But... Hey! Something new must catch the attention of the dev towards Microsoft.
If your page uses an MVC Web API for the REStful, it's really more easy to just use Razor pages. If not, I would recommend you to use Core MVC.

Adding existing Node Js project to Existing .Net Solution

Updated.
Updated the question since it looks little ambiguous and not the answer i was looking for.
We have a huge .NET application running on MVC and angular. It has multiple projects under the main solution. .
We also have a replica of that application in Node.js for front end developers.
It looks something like this :
What happens is - Front end developers make changes in Node js solution (like js or .less files or controller) - make changes and move those changes to .Net solution which is the actual live project.
Off late - we have issues with developers working with two different solutions (Node and .NET) and keeping two copies of assets everywhere.
We ultimately decided to combine them and bring the whole Node.js application into ours .NET Solution as 6th project.
Something like this
Wondering if anyone has previously done so - adding a .NET application with existing Node.js application. If so any pros and cons to consider.
Some points to note - the Nodejs project and .Net project are completely independant of each other. The idea is to consolidate the applications so that We can either run the .net application or UI application from single solution.
Eventually, we will consolidate all the assets to just one project so that - we dont have to do duplicates.
Also, would appreciate any links where I can see how to start merging these two applications.
You definitely want to look at JavaScript Servcies. Building Single Page Applications on ASP.NET Core with JavaScriptServices.
Made for .NET Core, but you can run .NET Core on Full .NET Framework, which should make it easier to migrate to.
What I think you have is, say, a production version in .NET and a development environment in node.js for developers which prefer that.
At the company I work for, we use AngularJS for our front end and .NET/Entity Framework back end and it works pretty well.
I'm not sure if you are integrating some sort of JavaScript back end in with it or not. Assuming you are going to stick with a .NET backend and a JavaScript heavy frontend, it should be fairly easy.
That being said, nothing in this career is truly "easy". I would recommend using an AngularJS frontend as it has seemingly endless functionality.
Some minor suggestions if you choose that route is to check out John Papa's style guide. great reference for writing AngularJS. Make sure you have consistent naming, especially in Visual Studio as AngularJS can be a little moody.
I prefer to bind values to the view when working on AngularJS, e.g.
vm.title = "Data I want to bind"; in the view: <h1>{{vm.title}}</h1>
If that renders as {{vm.title}} instead of Data I want to bind you know something isn't working. I prefer catching it sooner rather than later.
Dependency Injection is another thing to be careful with, the style guide covers it as well. Basically if you minify your AngularJS files and the minifier removes the information required for DI, your project will break. I've been down that rabbit hole a few times.
If you aren't intending on using AngularJS then forget I said anything. I was just exercising my fingers. I hope that helps shed a little light on your decision.

What CMS should I learn? .Net ones only

I am thinking of learning a CMS. I am not sure which one will be the best to learn.
I seen quite a few job posting asking for a website with CMS capabilities(so it seems something that would be good to know).
CMS on the surface seem to be easy to use but in my mind this seems to quickly change when I start thinking of sites that need more then just out of the box functionality.
For instance sites that need custom themes. How do you switch out themes with your own layouts? Or what happens if a page on your website needs to have custom logic and cms editing on the same page.
Like say you need to write something that pulls up data from a db and format it on the page but to the right of this data you have a paragraph that an admin should be able to edit through the CMS.
So how do you have this work? How do you add say the gridview server control to this page?
So I guess what I am getting up I looking for a CMS that has good documentation on how to do custom logic on pages and not just a CMS where if your not using there own themes and try to add your custom logic on a page you basically have go through the CMS and change the entire source code.
I like using asp.net mvc but as far as I can really see there is really only one CMS that is built on MVC and that is Orchard but it's still in beta and always changing. So I don't want to invest time to learn on how how to use it and then they make changes and your back to square one.
Thanks
It seems like you have 2 competing concerns: 1) which CMS might be best to learn for "professional" opportunities, and 2) which CMS might be best to learn for staying with relevant/interesting technologies like MVC.
For the first concern, a lot of that depends on how long a particular CMS has been around. For example, DotNetNuke has been around for many year, is well-established, and many use it to build commercial CMS solutions. It is web forms based. There are many other well-established CMS out there. For example, the Web Platform Installer from Microsoft, gives options to install WordPress.
For the second concern, I would recommend Orchard. Yes, it is in beta but it has been in development for a while now and is really getting better stability. Even if there are changes from here, I'd expect them to be minor and not sweeping changes to force to you learn a brand new paradigm. As you pointed out, it is also MVC-based. This let's you do development in a much more friendly way - and without having to jump through a bunch of hoops.
My friend used .Net Nuke to create a CMS.
http://www.dotnetnuke.com/
It was his final project in school and they still use it.
http://www.garneau-tennis.com/
The obvious advantage is that you can develop in .Net.
Check it out if nothing else.
N2 CMS would seem to fit all your requirements:
http://n2cms.com/
http://n2cms.codeplex.com/
I've created two CMS sites recently using this. It is probably the best developed CMS around although there is a learning curve. It also has an ASP.NET MVC version :-)
Several themes come with it out of the box. I have already built two custom themes myself and it was pretty painless.
Dot Net Nuke - Well established and using the MVP pattern to ease WebForms development / testing.
Umbraco - Another well known (ran on asp.net) and they are working on an MVC version.
Orchard - New, very new but all MVC. I think this will be a winner as it matures. It's not necessarily bad to get in early. Even as things change you will be able to pick them up and when Orchard hits the prime time you will already know it while all the others waited for it to get out of beta. :-)

MVC or Webform Architecture for new site

I'm developing a website , job portal. I have 2-3 years of ASP.NET webform development experience,
I want to create a professional job portal site (to improve and learn more) but trying to decide on best architecture. Any suggestions or advice will help...
Thanks
Well, there are a number of ways to answer this question, and I'm sure many others will chime in. I'll just say that since your goal is to improve and learn more, and you already have 2-3 years of webform experience, this might be a good opportunity for you to learn MVC. Then you will have experience in both, and can make more informed decisions regarding the best architecture for future projects.
Happy learning!
Whilst nobody can tell you exactly what to do, the team I manage is about to release a new CMS / Job portal using ASP MVC. MVC gives us excellent testability and scalability out of the box and it can be quickly combined with tools such as nHibernate / windsor (IOC) / nCache / jQuery - this ensures that you have a wealth of resources on the internet to help accelerate your development and skill. You can also embrace standards such as XHTML 1.1 strict, which is almost impossible with ASP.Net webforms due to the auto generated HTML
1 other advantage is that you also get away from the dreaded ASP.Net viewstate.
Use ASP.NET MVC if you want to:
learn the ASP.NET MVC framework
use jQuery or similar libraries
really learn web-languages (HTML, CSS, JavaScript)
use Test Driven Development
have a clean separation of concerns
If you don't have the time or will to learn to use the ASP.NET MVC framework correctly, stick with ASP.NET WebForms.
My answer is almost always "ASP.NET MVC." The amount of flexibility and features and testability and maintainabilty and ... heavily outweigh WebForms.
WebForms has the advantages of a rich ecosystem of existing controls and documentation, and is really powerful for some kinds of tasks (complex, multi-form interactions), but I find its limitations get in the way far too often. You have to mold yourself to it.
It really depends on what the end goal of the application is. As Scott Ewers said, if your goal is to learn, then using ASP.NET MVC will expand your breadth of knowledge in the ASP.NET space (since you already know web forms).
Additionally, if this is going to be a public product, you can leverage the testability benefits of MVC and run automated unit tests. Key ideas like Separation of Concerns can also increase long-term scalability and maintainability.
The primary reason why you might choose web forms is if you are rapidly prototyping the job board application. As you know, web forms allows you to drag-and-drop components onto the canvas to quickly create some basic data entry functionality.
There is a herding code podcast from May 13 on the subject.
Herding Code 47: Joe Brinkman on Webforms vs ASP.NET MVC.
I also agree that choosing MVC would have the advantage of allowing you to expand your knowledge. That not being the only reason, given the choice as well I just finished a small MVC project (my first) and let me tell you MVC rocks! Its a great framework which I feel gives you more flexibility and at the same time out-of-the-box tools to create a web app quickly and painlessly. It was my first experience with VS2008 & .NET FW 3.5 & LINQ, and all the guides at www.asp.net helped me go forward quickly (especially the free tutorial chapter from an MVC 1.0 book mentioned here).
I also got to learn JQuery along the way, as it is very much integrated into these new technologies.
One think to take note though is that this being a new tech, version 2 is already being cooked up, so if your project is for the long run, have that in mind and plan accordingly (in my case, being a small project, I'll probably try upgrading my project to version 2 when its officially released). Yet at the same time, having a fully MS (and thus MSDN) supported version 1 was a godsend for me...
Good luck!
I have good experience in Jquery, CSS, HTML, Javascript but not in TDD.
I have time..and willing to learn MVC but wasn't sure MVC is good choice for Job portal or similar site..
This can be considered a shameless self-advertisement but here is my quiz on how to choose between the two:
http://sietch.net/ViewNewsItem.aspx?NewsItemID=101
I was recently tasked by one of my clients to write a paper, or simply a checklist, that would help other lead developers make this same decision.
I posted the first 2 rough drafts on my blog. I am admittedly pro-mvc but the paper/checklist has been we received so it might be helpful.
http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/[http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/][1]
I think the most often overlooked benefit of MVC is convention; I really see any convention in webforms projects and while not strictly enforced in MVC projects at least its there.
i started developing our current app in webforms, mvc wasn't available when development started.. i've chosen the MVP pattern, with URL rewrite HTTP module. currently i'm investigating plugging in some MVC into this, basically to use the front-controller instead of using page-controllers. the other things in already established MVP architecture with web forms in my app give me more flexibility than pure MVC approach without WebForms, which i like, although require a bit more code than MS MVC examples (never tried it for real project to see if it stays that way, like in those examples in screencasts).
what i don't like with MVC is mixing control code inside templates - i believe loops, ifs and stuff like that just shouldn't belong inside the template. but a couple days ago i've ran into Spark view engine that looks kind of promising in that segment, although not still close to the Tapestry 5 (a component-based webGUI framework) in the java world.
But the above mention suggestion to mix both might work for you to explore MVC world and have the safe ground to fallback to if something won't work for you might be ok for you.

What's your ideal C# project built upon?

I'm starting a new personal project on the side, so this is the first time I'll be able to start from the ground up on a larger project since ASP.NET 2.0 was first released. I'd like this to also be a good learning experience for me, so right now I'm planning on building this upon ASP.NET MVC, Castle ActiveRecord, and Ninject. I'm most comfortable with MbUnit for unit testing and CruiseControl for CI so right now they are the front runners.
But what would be your first additions once you click "New Solution"? Open Source, commercial, whatever. I have an open mind if they look like they can make it do what it do.
Web Framework: MVC
Just a better way to make web applications
OR/M: NHibernate
Nothing really beats it in performance or features
Javascript: JQuery
Been using it before it got all cool. JQuery to me seems less like a framework, and more like a natural extension to the javascript language
IoC: Castle Windsor
Most mature of the .net IoC containers
CI: TeamCity
Once you try it, you will never want to go back
Testing: NUnit
They are all pretty head to head in features, I prefer the tooling (resharper) and syntax (been using it forever now)
Mocking: Rhino Mocks
Again, I like to go for maturity, especially in open source projects
In Hanselman ALT.net Geek Code, that translates to
IOC(CW):MOC(RM):TDD(NU):SCC(Svn):ORM(NH):XPP(++):DDD(T+):JSL(Jq):CIS(TC):GoF(++)
Built on nothing. Personally, I'm not a big fan of using frameworks and pre-built components for every single aspect of my project. I like to be in control of all the code, and write all the code myself. You could call it an extreme case of not invented here syndrome. Or you could say, if it's a core business function, do it yourself.
I prefer Microsoft Unity for IoC, for NHibernate make sure you look into Fluent NHibernate and say good bye to the xml garbage!
I wrote my own version of the Web Client Software Factory that leverages Unity instead of ObjectBuilder(1) that's included as I ran into numerous issues with it, at some point it will be blogged about in a series of posts but the source code is already on my site which you can view in my profile.
If your project is for an enterprise in all honesty I would recommend against using the MVC Framework. It's such a large derivation from web forms that you will find many developers that don't live and breathe coding will not be able to use it correctly and you will constantly be fighting to keep the MVC usage correct as most developers will treat it the same way as web forms.

Categories

Resources