Comments (3)
Microsoft guidance isn't the gospel truth. There's a wide community of .NET developers that explore things outside of the Microsoft box. CQRS doesn't mean anything other than having separate pathways for commands vs queries. There is usually a big distinction in what they do.
If you're looking for a Repository pattern with horizontal layers and unnecessary duplication then this isn't it. The vertical slices for operations allows for a more concise code base. If complexity grows then refactoring can group functionality and common code together.
The references on the README try to explain further.
from aspnetcore-realworld-example-app.
I have spent the last few days pouring over all articles on the README, articles related to Onion architecture, building my own prototype apps to learn some nuances of each and I can see both having their own place.
horizontal layers and unnecessary duplication
The repository pattern allows you nice isolation of your business logic in your services for test-ability. Anyone who has ever had to talk to SQL, Hbase, and Dynamo will tell you that they are probably thankful all they had to do was re-write their repository layer. All that to say I think each pattern really depends on your use-case and the complexity of your application.
I think this RealWorld repository is inherently flawed in the fact that it says "this is the best way to solve all problems". I like the showcase of things like adding Swagger, using cors, what libraries to use and how to abstract certain things away. Also popular libraries like these tend to get some experienced eyes on them which always makes me feel better when I read and use examples from code that I know has been proofed before. Even though I have recently added an issue about a lack of comments in this code base.
My original comment was just to warn people that this library uses a very opinionated pattern of problem solving and that its not the hammer for all nails.
from aspnetcore-realworld-example-app.
The repository pattern allows you nice isolation of your business logic in your services for test-ability. Anyone who has ever had to talk to SQL, Hbase, and Dynamo will tell you that they are probably thankful all they had to do was re-write their repository layer. All that to say I think each pattern really depends on your use-case and the complexity of your application.
Repostory doesn't give you anything but an unneeded layer of abstraction when what you want is something specific like the Query classes do. A quick google for repository anti pattern
finds a lot: https://www.infoworld.com/article/3117713/application-development/design-patterns-that-i-often-avoid-repository-pattern.html
This definitely does not say "best way to solve all problems" but it is a demo of more modern practices than things like the Repository pattern. It is definitely not a one-size-fits-all.
Every strategy is opinionated and tries to guide users down a path. Everything should be examined. As I've said, this is a demo of where a lot of the mindshare of some things that the community does outside of the Microsoft sanctioned practices.
from aspnetcore-realworld-example-app.
Related Issues (20)
- Problems with deploying HOT 1
- HTTP ERROR 404
- Security Risk - User Hijacking? HOT 4
- Database provider SQlLite hard-coded HOT 3
- Unable to delete article containing comments HOT 2
- Implement one database transaction per HTTP API call HOT 3
- CORS and pre-flight OPTIONS requests. HOT 4
- Missing app.UseAuthentication()? HOT 2
- Class vs Namespace HOT 4
- cannot use chinese for the title of article HOT 1
- Default connection string is hard-coded, only SQLite can be used. HOT 1
- can't connect to localhost:5000 HOT 1
- No License for Repo HOT 2
- Should .dockerignore include .git folder? HOT 2
- Circular references from Article HOT 3
- Wrong docker command for 'make run' in documentation node "Docker Build" HOT 1
- Adding an existing tag when editing an article causes an error
- Badly implemented GET /articles endpoint
- ASP MVC core frontend request
- are there any plans to upgrade this to .Net 6? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetcore-realworld-example-app.