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
-
guess you should use a better IDE which does all the refactoring gruntwork for you.
-
@tosensei to quote some devs:
Wait that works....
(and all our devs have an IntelliJ Ultimate license...) -
It's a special hell to run across DTOs/POCOs defined as interfaces, then inherited at least 3 layers, then someone decides, "Phone number? No, no no...should be a collection of phone numbers" and the interface breaks 20 dependent projects (in a mix of shared assemblies and nuget packages).
Then the monday-morning-quarterbacks jump in ..."if the interface was designed <dramatic pause> correctly with a collection you would have never had this problem". -
ars140811y@PaperTrail i just make a new one and deprecate the old one. If that is not doable for some reason I start to consider other careers.
-
@ars1 > "If that is not doable for some reason I start to consider other careers."
Ended up re-writing that entire system because of the interwoven complexity of interface dependencies. Looked great on paper, very 'academic', but far to fragile to an ever changing business model. Going on close to 10 years now with little/no changes to the underlying architecture.
A few guidelines that I follow:
- Interfaces define behavior, not data.
- DTOs/POCOs (the data) should be defined/used as close to the implementation as possible.
- Repositories/Managers/whatever implement the behavior on the data or use that data for the business process. -
Why are you developing in notepad?
Get familiar with your IDEs refactoring tools -
on a side note:
sometimes i _do_ wish i could declare a "reference implementation class" which the interface is implicitely derived from - just to avoid some typing overhead.
(with that being said - code generation would be an option here 🤔)
I think I hate interfaces
I get the purpose behind them, and I understand why they're best practice in most OOP situations.
But goddamn it makes me groan when I change a parameter in a method and then find out I have go do the same in the interface as well.
rant