ASP.NET MVC Code First [closed] - asp.net-mvc

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
When building an MVC application from scratch without a pre-existing database, is using the code-first approach the best way to do it?
While most applications are database-centric, it is perhaps the schema rather than the database itself that governs how the app is built around it. As such, I think a code-first approach isn't too bad. It was late to the party (happened after database-first and model-first), but I think the code-first approach will become the norm soon.
What's your opinion?

First i think that this link can provide you with more information
In my opinion both of the approaches are useful. A developer/company needs to decide what is the best approach for there system, in some situation.
I think one good distinguish is Big and complex against small and simple applications
I think that developers or companies will prefer "DataBase First" approach when they builds complex application. In most cases DBA's will be needed in such project.
In those cases the project will include Store Procedures/ Triggers and maybe also a Data-ware house
In the other hand when you build a small application with one of small group of developers you probably prefer using "Code First" approach
again this is my opinion...

Related

when is it most appropriate to use a micro framework? (instead of something like rails, django or catalyst) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I have spent some time familiarizing myself with
rails (ruby),
django...and other things like zope and pylons/pyramid (python),
catalyst (perl)
but often find myself wanting to use
sinatra (ruby)
bottle...or flask...(python)
dancer...(perl)
I'm not entirely sure...when I'm about to start a new project, which I should use.
What should be the deciding factor that makes me switch from a micro framework to something more substantial. Is it just when I would otherwise have too much SQL to write? I think not, because if that were the case I could just use an ORM library/module.
My main issue is a fear of choosing something that other developers would not understand if someone else needed to fix the site at a later point in time. Still I am still not sure what should inform my opinion.
With miсro frameworks you have more freedom in the use of libraries, you can add what you think is right. In large frameworks such as Django and etc already much that is "screwed" and there are certain rules and best practices how best to write certain things.

What is the most popular design-patterns in web app [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What is the most popular design pattern in web app?
I know that in asp.net mvc often used dependency injection and repository, but I want to know which additional patterns can I use in web apps. And it would be best if you give me sample of situation in which I can use patterns, or give code snippet.
Most of the design patterns we've developed as software engineers over the last few decades are still applicable for the situations they were designed for. Depending on your needs you will use most of these in web apps at some point.
http://geekswithblogs.net/subodhnpushpak/archive/2009/09/18/the-23-gang-of-four-design-patterns-.-revisited.aspx
Also below is a link to a site that shows quite a few of these patterns and has explanations / examples. They have their own product, which the site is a shop front for, but the site does have examples and contain code samples so may be worth a visit if you feel like it. most in C#
http://www.dofactory.com/Patterns/Patterns.aspx
Singleton is the most popular pattern. It is also one of best know anti-pattern (patterns that are considered to be harmful).
Every newbie uses it, because it lets you use global state, that looks like object oriented code. It also lets you avoid, that confusing dependency injection thing.
As for the "Gang of Four" book, there has been a movement by some uneducated people to remove the Singleton pattern in latest editions, but the attempts has been successfully thwarted.
Or if you have $28... C# Design Strategies with Jon Skeet
I haven't watched it but I do plan to buy it soon.
edit: IMHO the most popular design pattern in asp.net web development is the Smart UI anti-pattern ;)

What are the signs that I *shouldn't* use Ruby on Rails for a project? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've started learning RoR and I really like it - but it feels like it's oriented in one specific way - a very basic MVC model.
Which type of web application might not benefit from using RoR? Are there any signs I can find while planning the architecture?
I don't think there's a specific technical reason not to use RoR - it's fast, clean and can probably do anything PHP does.
The only reasons I can think of are the same consideration as to any other technology : Do you have the right people, is the legacy code (if any) compatible, are you in a market that makes it easy to find RoR people to support the code, and so forth.
There's also a nice Quora thread about this question :
If you have to install your website on a client machine that does not support rails/ruby.
If your code needs to be maintained afterwards by people that do not have rails knowledge.

Designing an asp.net MVC app with ORM and future migration to NoSql [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Just starting a new asp.net mvc solution and one of the requirements is the ability to scale for potentially millions of users at later stage.
I'm planning to use a generic repository that exposes IQuerable and use linq in the service/application level (I know It's not a pure DDD approach but this is not the debate :) ). I'm planning EF as ORM for dataaccess (with a distributed cache as second level cache to acheive the scalability at some extent)
The issue I will be facing is all those linq queries not compatible with any future NoSql linq provider (The Joins are unlikely to be supported in NoSql linq provider).
But I'm willing to take the risk of having to rethink all those linq queries as long as they are all located in one place : the service/application layer.
What would be a better approach? any recommandation ?
A NoSQL database wont solve problems that a RDBMS can't. Only well designed tables can.
I would use a NoSQL solution like RavenDb (since you are in .NET) from the start to decrease the development time and not switch later on.
Use CQRS if you want your application to scale. No need for an external query cache from start. Just do the interfaces so that you can switch to an external cache (or query DB as some call it) later on.

Case against stored procedures? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Any thoughts/comments on a database with over 3,000 stored procedures querying/accessing over 1,400 tables (overly normalized). Really want to use technologies such as Entity Framework, preferrably 4.0, and get the business logic out of those sproc's?
Appreciate any real-life practical experience & feedback if you decide to share. This is a database I inherited and really feel like it's time to ditch the sproc's for a better business layer.
Not really an answer to your question, but you can still use sprocs in Entity Framework: see here, basically sprocs map to method calls on your context object.
My personal experience is actually the opposite to yours though: I've usually tried to stay away from EF because it has this tendency to become so tightly coupled with your application. The nice thing about sprocs is that they allow a degree of de-coupling (e.g. I can update the database without modifying client code). But that's just my personal opinion of course.
This depends on the shop you work at. I've worked at many shops that have conflicting strong opinions about whether or not to capitalize on sprocs, or code in the application layer. The question is: do you have more people that are expert at maintaining plsql/tsql or not?
Personally I used to hate sprocs, and favored orm tools, etc. Now days I prefer to keep the application code clean. This is only after getting really comfortable in the database. Let the database code exist in it's native environment, with all of the tools available to it.
Why use Stored Procedures?
In practice, you'll end up refactoring away from EF in a few years whereas your stored procs could still be sitting there ready to use in the latest and greatest client layer. Client agnostic, encapsulating, etc.

Resources