28
votes
Accepted
Benefits of using separate API and UI servers for Web application
One reason is security - if (haha! when) a hacker gains access to your front-end webserver, he gets access to everything it has access to. If you've placed your middle tier in the web server, then he ...
26
votes
Accepted
What are the differences between .NET Framework, ASP.NET, .NET Core, ASP.NET Core and .NET Standard?
.NET Framework
is a VM, a JIT compiler, an object memory system consisting of a memory allocator and a garbage collector, a loader, a linker, and a runtime system (collectively called the Common ...
25
votes
Accepted
ASP.NET Projects using too much .NET Boilerplate Libraries / Code
When you start a project and have a particular need, you have a choice:
Either you implement your own solution from scratch,
Or you use an existent library or framework.
When implementing your own ...
23
votes
Accepted
Isn't CQRS overengineering?
Is CQRS a relatively complicated and costly pattern ? Yes.
Is it over-engineering ? Absolutely not.
In the original article where Martin Fowler talks about CQRS you can see a lot of warnings about not ...
22
votes
Accepted
What data should a repository return
And knowing (correct me if I'm wrong) that a repository shouldn't return a DTO
Theoretically, every layer (= project in your solution) should have its own DTO objects. In that sense, your ...
21
votes
Accepted
Difference between 3-Tier architecture and MVC (Model, View Controller) in ASP.Net
This is like asking what the difference is between an apple and an apple core. These two architectures aren't replacements for one another. I think a more accurate view is that the 3-tier architecture ...
21
votes
Accepted
Why do Microsoft's libraries depend on Newtonsoft.Json?
The most direct quote I've found is part of Scott Guthrie's announcement of the MVC 4 roadmap, back in 2012, (apparently offline but available via the Wayback Machine) which contains the following ...
21
votes
Accepted
Why would anyone use multipart/form-data for mixed data and file transfers?
multipart/form-data is a construct created for HTML forms. As you've discovered the positive of multipart/form-data is the transfer size is closer to the size of the object being transferred--where in ...
21
votes
Accepted
Is CQRS/MediatR worth it when developing an ASP.NET application?
I think you're expecting too much of the pattern you're using. CQRS is specifically designed to address the difference in model between query and commands to the database, and MediatR is just in-...
15
votes
Should I check for software on a users machine via a web browser?
You cannot check through a browser if the user have other software like Word installed. If that was possible it would be a huge security hole.
14
votes
Accepted
Where to put the Angular app in a ASP.NET Web API solution?
You have two options.
Create separate mywebsite.api and a mywebsite.app projects in your solution.
Advantages
Proper separation of concerns.
You can deploy updates to your api and your front end ...
12
votes
Can a caller abort an execution of code invoked by HTTP request?
HTTP doesn't work like that. The client sends a request, then the server sends a response back. No other communication occurs. Well, the server can send 1xx informational responses before the main ...
12
votes
Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?
Is it a bad practice to use X whenever possible?
Yes. It is bad practice to turn off your brain and lean on absolutes. It's far better to understand why.
So lets step back from that framework and try ...
11
votes
Time zone conversions on back-end or front-end
The general rules is 'Always send date times as UTC' and only convert on the presentation layer.
However, javascript is rubbish with datetimes. So I would do the required conversion server side and ...
10
votes
Is CQRS/MediatR worth it when developing an ASP.NET application?
CQRS is more of a data management thing rather than and doesn't tend to bleed too heavily into an application layer (or Domain if you prefer, as it tends to be most often used in DDD systems). Your ...
10
votes
Accepted
Application_Start() vs ApplicationStart()
This is an event handler, in addition to being a method.
The convention for naming event handlers is EventOrigin_EventName(...). Event origin can be a name of an instance (camel case), or a name of a ...
10
votes
Accepted
Why is it bad to map between a Model and a ViewModel in an extension method
It isn't how extension methods are supposed to be used, it is not in the spirit of extension methods.
I'm going to hard counter that notion, because it is exactly the spirit of extension methods.
...
9
votes
Utility Classes in MVC - ASP.NET
None of the answers previously given address the actual question. user60812 simply asked where one would place a utility class inside of an MVC project. Everyone harked on the singular example and ...
9
votes
Accepted
Never using Models, only ViewModels
Would my Data project be considered the "Model" for my application?
Yes, that's exactly what Model is supposed to be.
Is this a right approach
I believe it is.
or could there be potential ...
9
votes
How Common/Acceptable is it for a .NET developer to abstain from WebForms as a rule?
My observation is that WebForms is on the decline. There is a good reason for that. Having used WebForms extensively in the past, it's difficult to do something outside the box. In addition to the ...
9
votes
Accepted
why controller lifetime is transient by default in asp.net core?
There's a number of advantages to transient controllers. I cannot tell you whether any of them were the reason they were done that way - speculating about the intent of designers does not make a good ...
8
votes
Accepted
Migrate business logic from database into the business layer (.NET technology)
Be careful! If I understand you correctly, what you describe is going to be a lot slower.
Aggregate operations like Sum, Avg etc. is pretty fast if you run them in SQL. They will only be slow if ...
8
votes
Colleague wants web apps to behave like Windows desktop programs
User expectations should be taken into account when developing software but users are bad sources of UX/UI specifications. You need to have (or be) a UX/UI designer to design a UI that fulfills the ...
8
votes
Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?
Firstly, you are confusing singletons provided by a DI container with the "Gang of Four" singleton pattern. The latter is a glorified global variable and thus a complete anti-pattern and ...
8
votes
Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?
Before you change whether a service is Transient, Scoped, or Singleton, do make sure you are not introducing bugs. When something is designed to be thrown away quickly, there might be assumptions ...
7
votes
Accepted
Who does what in a Single Page Application?
So, I'm more experienced in PHP and Python but my answers should be valid for ASP .NET too, seen that your questions are more about the MVC structure rather than the language / framework itself.
...
7
votes
Accepted
Best Practice for masking Credit Card informations in Web Api 2
"We're logging every http request and response with log4Net."
Although im sure this is very useful for developers, its very bad practice and is potentialy illegal.
As you have pointed out you are ...
7
votes
Is CQRS/MediatR worth it when developing an ASP.NET application?
I highly recommend you view Jimmy Bogard's NDC presentation on his approach to modelling http requests https://www.youtube.com/watch?v=SUiWfhAhgQw
You will then get a clear idea of what Mediatr is ...
7
votes
ASP.NET Projects using too much .NET Boilerplate Libraries / Code
Yes, most places I've worked at use some of those libraries.
It is tempting to see them as bloat, I for one dislike Entity Framework and tend to 'hand crank' my repositories.
But, in fact the ...
7
votes
Accepted
At what point does a microservices architecture become "worth it" vs. a monolithic ASP.NET web application?
As I see it, the size of the application doesn't really have much to do with the microservices pattern. After all, you can always choose to build a few large monoliths or to build a monolith out of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asp.net × 627c# × 201
asp.net-mvc × 84
.net × 70
architecture × 58
web-development × 53
mvc × 42
design-patterns × 37
webforms × 33
design × 30
entity-framework × 29
web-api × 27
javascript × 23
web-applications × 23
sql-server × 22
web-services × 20
asp.net-core × 20
iis × 19
asp.net-mvc-web-api × 18
php × 16
security × 16
jquery × 15
sql × 13
authentication × 12
database × 11