Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
is it only me or adding 'dto' to class name is too annoying? Why having namespace if having to also add it to class name? Or 'dto' and db entities are in one folder?
-
@gitpush they are in separate folders. This is like it was when I open the file but to refactor all is spending the rest of my life just updating code. 😂
-
@gitpush last time I saw DTO in a code base it was a nightmare. It's some pattern people copy often blindly.
-
@RANTSMCPANTS I wouldn't be shocked if that's the case, whats next: UserRoleEnum, getUserFunction(string Id)
-
@gitpush The thing worse than suffix spam (which is sometimes a kludge needed to avoid name collisions, really bad if you have to go from one to two to three to four until you might as well use the fully qualified name) is DTO spam. As in people create them because of following some pattern like its a recipe for cake and you end up with nothing but an implementation of that pattern, often entirely automatically.
The result is that you end up with DTOs all over the shop particularly when people are trying to be enterprise with command bus, DDD, etc.
DTO to me, might be alright, but it's also often a strong smell of a code base where perhaps even 50% or more of the layers of indirection are pretty much just taking one anemic object, then spooling off it's values from getters into the setters of another objects over and over, back and forth. -
@RANTSMCPANTS The only thing I like about layer is separation of concern, as for models ya its bad then getting from one place and setting to an exact same object in an another place but just different namespace
It might be wrong but for models that are identical I just throw them in a different lib and then inherit from them when needed. -
@RANTSMCPANTS To me, Dtos are just common objects with properties, sometimes for specific transactions. They're useful.
Related Rants
When a function that sends an email to recover the password get's this summary I'm lost for words regarding documentation 😂
rant
c#
documentation