Skip to main content
12 votes

Banking System console app in C++

Please Provide Complete Code This sample doesn’t compile, because "hashpassword.h" is missing (and seems to rely on an external ...
Davislor's user avatar
  • 8,071
11 votes
Accepted

Banking System console app in C++

Preface: Code reviews can happen on different levels. Others have already pointed out many of the issues regarding potential bugs, syntax, stylistic choices and idiomatic use of the language. This ...
Simon Lehmann's user avatar
7 votes

Banking System console app in C++

User(int id, std::string username, std::string &password, int balance) Passing the username by value will most probably create an unnecessary copy of the ...
Coral Kashri's user avatar
6 votes
Accepted

Pass IEnumerable<T> as an argument of method and repository pattern

There is no general rule for using IEnumerable or not but there is one that says that you should use the most abstract representation of something because it gives ...
t3chb0t's user avatar
  • 44.3k
6 votes

User controller for a .net core WebAPI dating app

Errors An assumption: you never ever want to return a 500 HTTP status code (Internal server error). It may leak information you do not want to expose and it's not informative enough. Do not throw ...
Adriano Repetti's user avatar
6 votes

Should i throw exceptions in the service layer or repository, and catch it on the controller?

the idea that an exception should be thrown in exceptional cases is very vague, for example, if I can't find a user in my data source (repository) I can't continue the flow of my code, can this be ...
Peppermintology's user avatar
5 votes
Accepted

Cached repository implementation for small lists of data models

Cached repository should work above a normal repository, that's why a cached repository requires a reference to a normal one. This clearly indicates the Decorator Pattern but you are not using it ...
t3chb0t's user avatar
  • 44.3k
5 votes
Accepted

Users repository

You have a real interface pollution there. They do not provide any useful abstraction. Keep only one of them that you make generic. That's all you need. ...
t3chb0t's user avatar
  • 44.3k
5 votes
Accepted

Generic Repository without Entity Framework

I think you are in the right direction but let me suggest some things. Remove the try catch and let the repository throw the exception. Either that or catch and ...
ogomrub's user avatar
  • 176
5 votes

Laravel 5.8: prevent duplicated code

I think you can DRY this up pretty well by refactoring. This feels like a “ifs are evil” code smell to me. There are three “if” statements within that whereHas. They are packed in fairly tightly, and ...
James Clark's user avatar
5 votes

Repository pattern with Unit of work using ADO.NET in C# to authenticate user from database

Side-effects On its own, this: ...
Reinderien's user avatar
  • 62.8k
5 votes

Banking System in C++ [V2]

General Observations In reference to the previous answer, it isn't clear that the User class is still needed. The Customer class ...
pacmaninbw's user avatar
  • 24k
4 votes

Using dapper Unit of Work in 3-tier architecture

You're correct in point #1 that passing the connection string to each service to get your UoW instance is bad form. I'm not sure if that code was designed for a DI first world as is the case Asp.Net ...
Andrew's user avatar
  • 81
4 votes

Repository pattern with Unit of work using ADO.NET in C# to authenticate user from database

Some quick remarks: epaperconnectionString doesn't follow the proper naming conventions for compound words. Also: why wouldn't you store all your configuration ...
BCdotWEB's user avatar
  • 11.2k
4 votes

Banking System console app in C++

A banking system will inevitably require some level of concurrency, and your method of deriving the User id is not thread safe. Two (or more) threads could check the size of the userRepo at the same ...
Cameron's user avatar
  • 41
4 votes

Banking System in C++ [V2]

First of all, good improvements! Some points: UserRepository class stores the repository (or the vector) inside it; there is no need to accept the vector as a function parameter. No need to accept ...
Coral Kashri's user avatar
3 votes

Users repository

I can't say much about your code as it's rather short and it consists primarily of interfaces which can't be improved all that much, but there are few things that catch my eye : ...
Denis's user avatar
  • 8,508
3 votes

Event sourcing with Python

I started to review your code. Look # review: comments bellow: ...
Laurent LAPORTE's user avatar
3 votes

Mix of Repository and UOW For Business Library with Entity Per Table Architecture

I think it's wrong. Your entity types are mixing concerns and are no longer simple POCO types, they now have incestuous knowledge of a DbContext (which can access ...
Mathieu Guindon's user avatar
3 votes

Pass IEnumerable<T> as an argument of method and repository pattern

There is nothing inherently wrong with using IEnumerable<T>, just as there would be nothing wrong with using List<T>....
Ian Kemp's user avatar
  • 141
3 votes

Initialize global repository or in forms?

...
Mathieu Guindon's user avatar
3 votes

Method that fetches rows from database and maps it to a Model class with SqlDataReader

To quote Mark Seemann from the following article Small methods are easy to troubleshoot Write small methods. How small? Small enough that any unhandled exception is easy to troubleshoot. Break the ...
Nkosi's user avatar
  • 3,246
3 votes
Accepted

Expiring key/value repository. Java

Nice implementation, the code is well commented and easy to understand. My suggestions: Design Node keeps two pointers for the previous and the next. The repository ...
Marc's user avatar
  • 5,604
3 votes

Unit of Work & Repository Pattern - Injecting UoW into Repository Base

Quick remarks: Transaction() is not a proper method name. OwnerTable.Title: a table has no "title", it has a name. <...
BCdotWEB's user avatar
  • 11.2k
2 votes

Disposing the Context in the Repository pattern

The container calls Dispose for the IDisposable types it creates. Services resolved from the container should never be disposed by the developer. If a type or factory is registered as a singleton, the ...
nadjibnet's user avatar
2 votes

Manage connection without 'using' statement

You could do the following approach: ...
Greg's user avatar
  • 539
2 votes

Resository Pattern and Unit of Work with ADO.net

It's a good start. Here are the changes I suggest: I think you should be able to execute the queries without sharepoint. To make it possible we'll remove the sharepoint stuff from the repository and ...
t3chb0t's user avatar
  • 44.3k
2 votes

PHP OOP Repository overview

At first glance, a couple of things I'd change about your code are: Follow coding standards, PSR being the most commonly adopted standard out there. Class definitions and method definitions have the ...
Elias Van Ootegem's user avatar

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