Skip to main content

Questions tagged [interfaces]

Questions about `interface` related design considerations, and also "programming to the interface instead of the implementation"

0 votes
2 answers
142 views

I'll get straight to the point. I want to implement a class structure in Java similar to the one in the image. Am I falling into bad practice with this kind of diamond-shaped interface implementation?...
A. WW's user avatar
  • 11
3 votes
7 answers
555 views

I'm working on a custom Magento 2 module in my internship, and I'm trying to follow SOLID principles in my code. Right now, my controller actions handle everything: getting request data, processing it,...
Ruben Eekhof's user avatar
3 votes
4 answers
408 views

When designing a pure virtual base class (interface) in C++, in what cases would I not want to allow polymorphic deletion via a pointer to my base class? I've seen questions about why you should make ...
ToddR's user avatar
  • 335
1 vote
2 answers
229 views

Let's say I am coding an C++ application which needs to drive some motors with some hardware interface (USB, Serial...). There are several kinds of motors, which expose the same services, but with ...
Oodini's user avatar
  • 147
2 votes
4 answers
479 views

I recently came across some code: val, ok := i.(SomeInterface) if ok { val.Method() } The above is Go, and attempts to cast to an interface and then runs the method for that interface against the ...
DubDub's user avatar
  • 645
-2 votes
1 answer
221 views

Some may think I'm kidding, but I'm really stuck on this Suppose you have some UserDao interface that you want to implement What should you call it? Here are a few points I'd like to make I firmly ...
Sergey Zolotarev's user avatar
0 votes
1 answer
437 views

It might be that my question would sound a bit stupid but I would like to find the best way for naming my DTO interfaces. In my PHP application I have following DTO types: Simple (which contains a ...
Viacheslav Ravdin's user avatar
4 votes
2 answers
308 views

While developing my application I faced an interesting situation: I have multiple DTO's which are almost identical in terms of methods, only properties are different. For example I have AccountDTO ...
Viacheslav Ravdin's user avatar

15 30 50 per page
1
2 3 4 5
50