Tag Info

Hot answers tagged

18

I'll share the way I ended up doing this, that was part of the original question. First, the problems I encountered: With customErrors on (i.e. in production) the global HandleError attribute swallows exceptions and renders your error view, but then you can't log it with an addon tool like elmah, since elmah never sees it. You could log it in your view I ...


14

Not a whole lot. The people to program things, and the people to manage the infrastructure are a few orders of magnitude more expensive than any hosting cost issues you can run across. There are plenty of free "gems" -- check out nuget for .NET's version of that. Cloud-wise, both EC2 and Azure offer windows boxes so you aren't stuck owning hardware. The one ...


11

I'm now looking at node.js and it's performance implications (I'm addicted to speed), but I haven't delved into it all that much. Profile, profile, profile. That's the only way to know that your speedups are having the proper affect. You can guess that it's fast enough. But most people like to prematurely optimize. That's worse than playing with ...


11

"Is it acceptable" is not a technical question; it's a product question. In some products, 2-6 seconds might be considered hideously slow while in others, 15-20 seconds might be pretty zippy. How fast are competing products? How fast are similar products? What percentage of customers will see the long original query vs. the faster cached query? If you ...


10

Serving js, css and other static stuff from a DLL is asking for a performance disaster if your site gets a lot of traffic. A regular MVC project would let IIS handle them which would yield a lot more efficient use of caching on both the client and the server. Your primary reason for wrapping it all into a dll seems to be purely for deployment comfort. A dll ...


8

Is there any easy step-by-step reference to MVVM? Yes, there is. Take a look at the here. Is MVVM a super-set or a sub-set of MVC? MVVM belongs to the MVC family, so, if you can say that at all, it's a subset. It's a variant to decouple the UI from the business logic underneath. I'd describe it as a sibling of MVC. Since the early days of OOP ...


8

I prefer to put binary in the database, but that's primarily because I know where it is, and I don't need a systems guy to set up a network share or webserver. I can control who can retrieve the data through my application, rather than rely on permissions on the file system. I can do it on a very granular level very easily. I get much simpler transactional ...


8

TerryR my friend, you and I should have a drink. We have some similar problems. 1. Project Structure: I agree with Eduardo that the folder structure in an MVC app leaves something to be desired. You have your standard Controllers, Models, and Views folders. But then the Views folder gets broken down into a different folder for each Controller, plus a ...


7

It's syntactic sugar, basically. I don't think it's meant to be functionally "better" than the old ViewData dictionary, just a lot less verbose to work with. Instead of taking things out of the dictionary and manually casting them (and crashing if they're wrong), you can just use them without any extra verbiage (and crash if they're wrong). Here is a blog ...


6

Fat controllers are the biggest obstacles that I encounter. Rule of Thumb with MVC: Keep your models fat and your controllers skinny. For more background, please see this thread.


6

Everything the controller is doing there is its job, its pretty basic stuff. Business logic is not going to be generated for you. Models get fat when you encapsulate useful functionality into them; you can't expect to see that from a template.


6

It's better to create Mock up screens first, as it will give you an idea of the Actors and Use Cases. But the mock up screens should be just that, and later, you should be coding them again according to the dynamic logic you would want. Next, you should proceed to develop a data model for your application. The ASP model should reflect that. Finally you ...


6

I'm not going to write a full answer, but want to share some tips. My tips: 1. Project structure I've found that the default MVC structure is not good for me. I generally work in the controller, views and model of the same entity (think product, order, customer) at the same time. So, I like to have the files in the same folder, but with different ...


6

static ObjectContext class This is actually even worse than what you think. The ObjectContext class is not thread safe so even if you manage to get what you think is good synchronization, (without actually locking) you will still be throwing exceptions all the time in a multi-user environment. The ADO.NET team recommends using a new ObjectContext ...


5

I think that MVC, ASP and your favourite logging/exception handling framework can handle your goals quite nicely. ELMAH and Enterprise Library both provide easy to use exception handling and logging so pick your favourite .. I'm not going to go into the pros and cons of each here. NOTE: you can't display a friendly error page AND return a HTTP 404 or 500 ...


5

Personally, I really like Ninject. It's simple, yet powerful and allows you to achieve the "easy" parts of DI easily, whilst still giving plenty of scope for more advanced DI scenarios. It's also fairly lightweight and easy to set-up within your project/application. This is especially true for ASP.NET MVC applications if you're using NuGet, as there is a ...


5

If your just doing restful architecture using CRUD repositories there is no good reason to port an existing application to node.js. If your writing a new application that does REST and CRUD there may be good reasons to use node.js from the start. It's really per application dependent. For example personally I would write REST/CRUD applications fully in ...


5

Temporarily putting things in the session is going to lead to strange behavior when a user opens up 2 or more windows. TempData is best for persisting data briefly. Also, sessions can be cleared a variety of ways. TempData will rewrite a bit of data on the page to be posted back and will last as long as the window isn't closed. There's also the problem ...


5

I have been using MVC 2 for more than 2 years now, and have application in production from early 2011 which works fine. Currently, we are using MVC 3 in our project without any problems. I compiled some posts that shows why MVC3 would be more productive for your project. MVC 2.0 Vs 3.0 Performance Introducing ASP.NET MVC 3 (Preview 1) MVC 3 Project Upgrade ...


5

If I can be quite honest here, I was in the same situation you're in. I wanted to host a Rails applications because I was under the impression that it was cheaper to host. After all, it's Open Source right? Not the case. In fact, almost every Rails project has to be run on a high-tier hosting such as Heroku (initial costs about 39$), because if you run it ...


4

Due to lifecycle issues and the need to keep state between page posts, you will find it very hard to reuse 100% of your none UI code between web and WPF. Asp.net does not have the powerful data binding that is needed for MVVM, also a lot of the logic needs to run in jscript these days as people expect the UI to update its self without the need for a ...


4

Based on your comment above to my question where you stated that the Status controller is only used for AJAX calls currently I would still leave it separate from the Orders controller. The MVC idea is that the controller acts like a traffic cop for incoming requests and determining the out going responses. Even though you aren't returning a view per say you ...


4

If I understand your question correctly, I would say it is because you generally don't have explicit control over the parameters passed to an action. Remember that the model binding will, by default, take them from a number of different places, including ones that are outside your control, like querystring. It sounds like you're thinking that you should be ...


4

When you want to work with ASP.NET MVC Scaffolding, you should consider these items: The HTML tags are defined in scaffolding The id and class attributes are defined already The HTML tag nesting (like putting a <p> tag inside a <div> tag) is defined already The HTML helpers are used by default Because of these reasons, every time I used ...


4

You may want to try TeamCity or any other Continous Integration Tool. We use TC and it's really painless the deployment process since it takes whatever you have on your Source Control Server (SVN in our case). TC isn't free but I think there are some other tools that do are


4

Visual Studio and IIS supports MS-DEPLOY. You can read more about it here: http://learn.iis.net/page.aspx/1080/testing-web-deploy-publishing-from-visual-studio-2010-and-webmatrix/ But basically you can have different profiles for your project and different "versions" of web.config where you can transform things like connection strings, application settings, ...


4

The best thing for you to do is just to start with the default MVC scheme - where controllers and actions are 'allocated' by URL convention, with the first part of the path determining the controller, and the rest of the URL (and the request type, e.g. GET or POST) determining the action that'll be called. Whilst at first this seems like it must lead to a ...


4

I think dreza's answer addresses the coupling issue, but it continues what I see as a common flaw -- multiple projects. Multiple projects are used a lot more frequently than they are actually required. Unless there is a PHYSICAL need for multiple projects, they simple add complexity without much, if any, benefit. Take your problem as an example, at best, ...



Only top voted, non community-wiki answers of a minimum length are eligible