What are biggest problems being had with ASP.Net MVC [closed] - asp.net-mvc

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
What are the biggest problems that is being encountered with ASP.Net MVC and what have you done to work around them?
So far my biggest problems are:
Problem: Keeping up with the changes (RCx, beta, etc).
Workarounds: Compiling till it works.
Problem: Remembering and dealing with the Futures DLL.
Workaround: Download the latest, compile till it works.

I haven't had any real problems. That said I have written my own library of useful helpers to make life much easier for me. Most of it is similar to the futures library, but i think i've taken mine much further. It mainly revolves around integrating form components, model binders and validators together so that you can get a fully working, validating CRUD page within seconds with minimal code.
I quite like the fluent validation
Rules(
Ensure(x => x.Date).IsLessThan(DateTime.Now),
Ensure(x => x.Telephone).HasMinimumLength(12),
Ensure(x => x.Email).IsValidEmailAddress()
);
That said, futures by itself is an excellent package and makes mvc a great tool to use. I think the main problems with it are the lack of comprehensive tutorials and documentation. As its relatively new and been through so many breaking changes recently that many blog posts on the topic are out of date.
I think once its hit RMT things should get easier for beginners.

Documentation, documentation, documentation. Additionally we need a one stop place for best practices beyond the basic beginner stuff. The ASP.NET MV C page has nice tutorials, but most are simple tutorials. We need a Cookbook of sorts I think ;)
I think all this will come with time - especially after the final release. however it is a bit frustrating to get going now (even with RC2) and have most of the stuff out there already outdated since it references Beta and Preview code :(

It seems like most tutorials have the validations set up in the controller, rather than the model, which I don't like
When you compile your code, it doesn't compile code that's in the views
The routes are a disgusting mess
I'd like to switch some of my projects over to not use code-behinds, but either they all have to have code-behinds, or none of them.
The testing still isn't matured (I think that will come with time, though)

It's worth nothing that ASP.MVC 1.0 is RTM as of today.

You realize you are using preview/beta/RC software, right? It is to be expected that things will change.
Most of the problems I have encountered in working with ASP.NET MVC over the past year or so have been a result of my ignorance. Preview 2 -> Preview 3 was a real pain, but that was about it.
Right now, the only thing I really fight with is
return Json(data);
It sees circular loops in my data when I really can't find any. I'm sure there's some behavior that I'm not aware of causing this, so I'm attributing this to my own ignorance still. Maybe if there were some way to tell it to ignore certain properties, I could work around this without having to build a Dictionary/List every time I want to return JSON from an action.
Another thing that I really don't have a problem with, but I remember a lot of people whining about, is that so many methods take anonymous objects. Namely route definitions. Intellisense doesn't tell you what kinds of key/value pairs a method expects in its anon. objects, so it can be difficult to use if you aren't familiar with the framework.

I love the fact that it is cutting edge and I even enjoy the challenge of upgrading my apps (although sometimes I push it off 'till I have more time).
what bothers me sometimes is the lack of mature controls that would make simple recurring tasks (think validation, data binding) much easier.
But never during my day do I regret using MVC or even consider using webforms. I am hooked on asp.net mvc and haven't made anything larger than a single form on anything else fro over a year.

I think the fact that you have to run something to even see if it "Really" compiles is its biggest obstacle. All that "CODE" in your HTML markup can lead you easily down the path to the classic asp spaghetti code problem. Look for the compiler to improve in later versions.

Related

What ASP.NET programming model to choose? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Summary
I'm a seasoned programmer with years of experience in Windows Forms development using different programming languages as already stated in this question:
Will learning WPF improve my skills in ASP.NET?
ASP.NET or any Web based programming language doesn't feel natural for me to explore or to use. Although I am unfamiliar with Web based technologies, my curiosity about these grows and grows. In addition to it, I am aware of the market place Web based programming takes. I would like to expand my knowledge and experience to the Web, though would it be just to know what I'm talking about instead of speculating whatever.
My experience as an information and process systems developer allows me to understand the concepts and some of the basics. I am aware that Web based applications are stateless, for instance, and that I need to use session or viewstate variables to keep the information the user is working with alive, otherwise I would loose them.
I also understand the basics of Ajax based controls such as the UpdatePanel, which is to update or to refresh only a part of a UI page rather than reloading everything through the connection again.
I can get that CSS defines styles for your page's sections and that you may change radically your Website's aspect just by changing the CSS reference.
I am also aware of masterpages, which I don't really understand, in fact.
Programming Model
I just watched this video about choosing the right model for me/my application:
Choosing the Right Programming Model
If looks like ASP.NET MVC, which I thought was the best approach, is more for the veteran Web developers, people who are comfortable with Web applications.
I have used a lot of DataBinding in Windows Forms, and WebForms seems to be more what I'm looking for into ASP.NET, until they say that MVC allows for Unit Testing, TDD and Agile methodologies, which I adhere to, as a certified Professional Scrum Master.
I'm a bit mixed up on what will be more natural for me speaking of programming model.
Questions
Taking into account my base of knowledge and my experience, what programming model do you think I'm going to be more comfortable with?
Will choosing one over the other allow me to get acquainted enough with ASP.NET to one day try the other model?
In the video about choosing the Programming Model both sat on ASP.NET, I heard about DataBinding while using Web Forms, but no mention of DataBinding in the MVC model. Is there any possible DataBinding in MVC?
Finally
I'm very confused about all of this ASP.NET stuff.
This is so subjective that it's likely to get closed and no matter what answer we give, it's likely to get downvotes as well as ups, BUT....
Given your familiarity with WinForms development I would say to go to WebForms if you want to get up and running as quickly as possible. Even if you eventually switch to MVC, you'll be more comfortable with WebForms at first while you learn the ins and outs of web development, so it will be less of a shock to your system.
And just so I don't get pegged as being biased by the others who will view this, I realize that there are many advantages to MVC, but in my own humble opinion, I think it's silly to get into a "Which is better" discussion. I'm giving this answer because he asked (paraphrasing) "which will be easier for me to grasp and get started with".
Edit
I guess I only addressed the first two questions above...
For the third, databinding in MVC is a bit different, but not all that much. The data access under the hood is the same, but you control the output a lot more strictly.
See this other post for a quick glimpse at a good answer explaining how to do a simple "binding". The asker in this question was less familiar with MVC, and was asking how to do databinding on a drop-down list in MVC. The answer given was good, and pointed to a good article.
ASP.Net MVC framework and databinding
just go with asp.net mvc.
it will actually improve the way you write windows apps.
its a mistake to try and find the closest similar paradigm to what you are used to. Its almost better to have a completely different one as it will save getting confused by things that are similar but not quite the same.
basically webforms was microsofts attempt to make it easier to do web stuff coming from the windows world. But its akin to coming from a sailing background and developing a "car" that you control as if it was sail boat. You are simply better off learning how to drive a car, drive when you have to drive, sail when you have to sail.
so you will have to put in the effort to understand web stuff. Its not too hard, it can just take a bit of time. But there is a massive resource of knowledge to draw on.
basically come to web development with your cup empty ready to learn :)
I use WebForms and I came from VB6. It was weird at the start when I had to learn about the page cycle.

Should I use JQueryUI in my project? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I've been playing around with JQueryUI for my latest project. I've run into some issues and questions, and I've not been able to solve them either myself or with the help of SO.
Here's my current impression:
Styling the UI seems quite daunting .. a lot of "framework" to understand before being able to do stuff
not much help either by googling or by asking questions on SO .. doesn't look like there is a huge community to support it
What is your opinion? Should I "tough it out" (I admit that this may be more my problem than a problem of JQueryUI) or should I look for alternatives?
I have to admit to having some reservations about jQuery UI. Basically it comes down to this: it smells funny.
Now I have enormous respect for jQuery proper. It's fast, lightweight and it solves a whole heap of browser compatibility issues. It's also extensible via plugins that you can use or not at your discretion.
jQuery UI is a different beast. The whole theme thing is really heavyweight. What I mean by that s that, for example, if you just want a date picker, you need a theme for that and thats a lot of CSS and a lot of configuration just for a datepicker. Compare that to a datepicker plugin where you just use it (or not).
The whole premise of the heavyweight theme thing is that it looks built to a huge UI framework with a dizzying gallery of widgets... but there isn't a dizzying gallery of widgets. There's just a handful. So why the complex theme configuration?
To me it just seems over the top. If I were you I'd pick up widgets for things you need and possibly look at something like jQuery Tools, which seems to be less convoluted.
In my opinion jQueryUI is a mature and reliable framework. There is definitely an active community supporting it and plenty of information is available on blog spots and discussion forums.
Have a look at ThemeRoller. This is an excellent tool for easily creating themes for jQueryUI. It will help you when starting playing around with it.
I would perservere with it, but bear in mind that if you have what seems to be an insurmountable problem with a particular control there's generally an alternate version available in one of the many blog posts that have sprung up about JQuery.
By sticking with the framework, you'll learn how to extend it yourself, which will allow you to introduce new functionality (for instance, I recently wrote an internationalisation component in JQuery that allows me to retrieve resource strings from a web method via AJAX calls in ASP.NET).
And why not? I'm using only a few things from it and i feel happy (i.e. - 'highlight' effect).
Just don't forget to reference it through Google Api. As long as you do that - it's quite likely that you do not slow anything down (at least - not much) and lose practically nothing.
Did you consult the jQuery-UI discussion group? Maybe you can get more help there. If not, and if you decide to use jQuery-UI, then there's also commercial support (see here).
I don't think it is all that useful. It used to include autocomplete, which i thought was the most useful feature, but then they suddenly dropped it. It is a huge download if you include everything.
I've found jQuery UI quiet handy when I need to whack something together quickly, i.e. for prototyping, but like you I've also found support somewhat lacking and as mentioned above the theming leaves something to be desired.
On a recent project, looking for an alternative, I've used a couple of widgets from YUI and I have to say I'm very impressed with the whole architecture and methodology behind it. For example their autocomplete abstracts away the data source and provides overridable methods to fine tune the results set.
Finally, if I have time, I'm a big fan of rolling my own widgets. Re-inventing the wheel can be a great way to expand your knowledge and you never know, you may happen across a better solution :-)

What technologies to use for starting up a new project? (Technology Prespective) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Today I had a nice opportunity from my manager to propose new technologies to start up a new project. Here we used to use ASP.NET and SQL mainly. I really wanna propose using ASP.NET MVC and LINQ To SQL and do some nice TDD. The question is, i don't know how to convince my manager, actually i'm not sure of these choices myself. Could you please be me and propose the set of new technologies that you think is the best, and also propose some resources in case the developers don't know about these technologies, and any thing else that we might wanna consider during that transition.
PS: The project is a web site, and uses Amazon Web Services a lot, the good thing is, it's an internal project and time is not that much of a constraint.
Waiting for you sweet SO fellows.
The obvious, if not immediately helpful answer is to go learn about any technologies before you recommend them to anyone. If you are not convinced then go pick up one of the bits of kit and try to make it do something.
.Net MVC, Ruby on Rails and a raft of other platforms exist, pick 3 and try the same project in each. That way you'll soon have an idea of which you think is the strongest and convincing you manager will become a simple case of "Technology X is better because it will take us less time to build a more stable product which will save you money".
I had the same situation recently too.
Combo i use:
ASP.NET MVC
Cause i`m tired of webForms. And mvc is supposed to be faster in general.
StructureMap IoC
Cause i want app to be loosely coupled, tried it first and it does the job good enough.
NHibernate
Cause it fits DDD best despite of lack of sproc support.
RhinoMocks
For now - it just sits in my tool belt waiting for it's turn.
AutoMapper
Not needed anymore cause of NHibernate mapping capabilities.
MsTest framework
Still haven't seen any good argument for switching to another.
JQuery
Cause i dislike MsAjax framework. It's too clumsy.
MVCContrib
Cause it makes ASP.NET MVC apps easier to write.
Fluent NHibernate
Cause it gives better approach to configure NHibernate.
Trying to follow TDD and DDD. Gradually rewriting old legacy application too.
So far - so good. :)
I think if you are going the MVC route, you should probably also consider learning JQuery too.
You could say that ASP.NET MVC and LINQ to SQL really boost productivity and are really easy to maintain. Also the logic get's separated so well that testing is a breeze.
Give SO as an example of how successful and scalable solutions in ASP.NET MVC with LINQ2SQL can be in those new technologies.
Do not dive into the pool before knowing the depth or you will hit your head on the pool floor. I understand its a internal project but before you pick any technology stack. I would do the following -
Understand the team strengths, I dont want my freshwater fish trying to swim the ocean.
Understand the domain bits as much as you can. Not all technology stacks solve a problem in the same way.
You say time is not an issue but time often is the driving force. Set a feasible timeline.
Prototype some bits of software.
I think you can narrow down to the technology stack you would want. My options would be -
ASP.net MVC + Entity Framework + jQuery + Silverlight (if RIA is a goal)
MonoRail + NHibernate/ActiveRecord + jQuery + Silverlight (if RIA is a goal)
Mix and match 1 and 2
If webforms is something you like or suits your team's skill set, why not ? There is lots coming our way in the new .net version.

How do you remember/organise Rails information to prevent wheel reinvention? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I love working with Rails but I keep tripping up against my own inefficiency: I'll spend time implementing some "useful" function only to discover subsequently that it was already in the framework, had I but known it!
Particular areas of wheel reinvention for me are
helpers and built-in class extensions
recently-released features that may not yet have lodged in my brain
plugins (a taxonomy of Rails plugins, if such a thing makes sense, would be a boon)
migration options
less-frequently used rake tasks
the options hash on just about everything
Obviously (?) we can't all remember all this stuff all the time. There are "cheat sheets", but unless they're up-to-date they can potentially compound the problem by appearing authoritative when they're really targeted at older versions.
What do you do to minimize this excise? Can anything be done?
I wondered if a set of Big Visible Charts might help, although goodness knows where I'd stick them in an open-plan office.
One thing here is to know about the existence of particular feature (plugin, gem, etc) in the first place. That's why
I try to keep up to date with the information about the edge Rails.
I follow many blogs and try to if nothing else then run over the titles every day, just to have it leave at least some tiny footprint in my memory.
That's for the passive part. Now for the active:
As I fly through the new features/plugins I try to imagine at least some use case in which it might be helpful in what am I working on right now - this exercise helps me to remember the thing, since I connect it to my actual conceptual system.
In my less serious projects I really try experiment with new things.
On SO I often answer questions I'm not sure about or I don't really know anything about but they seem interesting to me - then I do some research and extend my knowledge on that particular topic.
I don't think that "big visible charts" can help in the long run. I only use cheat sheets when learning new things and it's really only a short term thing. Exellence is a habit, as Aristotle said.
This isn't just a problem with Rails, but with any framework. Programmers I know who have worked for years with Delphi still are shocked to find simple standard functions that they'd replicated.
WRT Rails, Mike Gunderloy recently wrote about highlighting text, and ended with this wise tidbit:
It’s worth taking a dip into ActionView::Helpers occasionally to see what other bits of functionality are lurking that you’ve forgotten about.
Any time I need to do something I think should be easier than it is, I do a quick check there, as well as Google, to make sure I'm not about to waste a ton of time.
I face this problem as well- and it was a lot worse when I first started with RoR. Now after over 1.5 years, I know what's available pretty well.
Basically what I do is if I am using parts of the framework I know... no big deal. If I need to do something I will likely have to create myself, I first google it or search the Rails API. Lately I have also begun searching github and some of the plugin sites like railslodge.com.
While this does not completely solve the problem, it has helped dramatically.
I surf over the rails blogs in my RSS feed reading the headlines and just enough to figure out what the article is about. This gives me a good breadth of knowledge but pretty shallow. Still it lets me know what is out there. Like yesterday when I saw a blog post about a highlight helper (I had no idea it existed. Now I do and if I ever need it I know to look for it - even without reading the post in depth). I also open the posts I want read in depth in another tab for later (I used to use ReadItLater but it got out of hand) and as i read them i write notes in a post on my own blog more for my own benefit than for others - to get into memory and to ensure I can find it later.
The other thing I do when I am entering uncharted or forgotten territory is to I ask a question here about best practices or specific details even if I think I know the answer. For example I couldn't remember the names of the popular plugins for tracking edit histories of records (acts_as_audited and acts_as_versioned). I had the answer in 15 minutes.
It turns solo programming into programming in one of those cool noisy dev shops with a foosball table and lots of other people who know stuff i don't.
I tend to assume that most types of basic problems I'm solving have already been solved by someone else; by starting with the assumption my thoughts aren't along the lines of "how do I build this" but "where do I find it" and of course google, the wikis and the plugin and gems lists all play a part in that. I have written very little code that isn't directly related to my business domain.
I write tests first. Then code. Sometimes the framework does it for me and I don't have to write code. :)
I don't think Rails is any different than other frameworks... it takes a while to know where things are. The best you can do is read the API docs and see what's there. You don't need to learn how to use it, just what is there and get an idea of how to look for it when you need it.
Also, it's not a bad thing to write code that someone else already has. You learn from it. Later you just swap in the framework mojo and see if your tests still pass. If so, you're good and you know how the internals of one part of the framework probably work.
I believe the key to eliminate the time wasted on reinventing the wheel is to have a very handful tool to search inside the Rails helpers/capabilities.
On one hand a good choice of IDE could help a lot. On the other hand - a very good online (offline) edge documentation with an ability to quick search through it. These days one of our russian Rails programmers made one: http://railsapi.com/. The search is done in a very MacOS style, making it a very good choice for a fast diggin'.

Converting from Web Forms to MVC

Has anybody gone through the process of converting a real-world business application from ASP.NET web forms to MVC? How painful was the transition? Would you say that it was worth it, overall?
I am trying to figure out if it is worthwhile to take the time to convert an application over to MVC for increased performance.
This is just an opinion but I would say don't do it. I've looked into this and have decided that we will use MVC for new apps and total rewrites because of the huge differences involved.
However I guess this really depends on what your asp.net pages looked like in the first place.
I am currently in the process of converting a couple of web form projects over to MVC. At first it was more to get familiar with the MVC, but now I actually really like how the model and the separation it provides.
The transition over has been a little hard in some area's in that there really isn't a lot of material other than some blogs, stackoverflow, and a couple of video casts. There are two books that are semi-available but, one is already kind of useless in that there have already been a number of changes to the framework that there are better ways in handling some things.
I also think you will have to really start to learn jQuery if you are already not familiar with it too. So for me - I feel like I am really learning two things as I've been doing this.
But worth it over all, I would say yes. And I think that converting a small project over is also really a great way to start.

Resources