All Questions
Tagged with inheritance design-patterns
16
questions
2
votes
1answer
81 views
Builiding a Model from Stored Procedures
After reading that Data Classes can be considered a code smell, I am shifting from a pattern with many data classes and a single manager class that handles all the instantiation of the classes, to a ...
-2
votes
2answers
71 views
Multiple inheritance of class broken up into modules [closed]
I have a class Main that uses fn(cls, ...) methods from several modules; they're used exclusively by ...
5
votes
1answer
262 views
Strategy pattern in C++ - the Duck simulator
I'm studying design patterns from Head First Design Patterns and, in order to get confident, I plan to implement the each pattern in C++ after studying the corresponding chapter.
As regards the ...
-1
votes
1answer
87 views
Class Inheritance in C# (possibly generics) [closed]
I'm working on a segment of code where it runs a number of tasks and then combine individual task results to construct a complete task result object, there's no concurrency involved so it's purely a ...
3
votes
1answer
1k views
Try again, and again, and again… but not too often because the potatoes won't grow
The delay sequence has been fixed so I can move to the next step which are the Retry and Breaker.
(Just ignore the console ...
0
votes
4answers
209 views
Multilingual command handler using inheritance
My problem is that you have a lot of ifconditions to be checked and inside that if condition you have multiple lines of code. I ...
-1
votes
2answers
390 views
Swift inheritance versus composition
Say I'm using Parse Server and utilising the PFObject class from the iOS SDK. Say I want to have a Chat class.
To use inheritance code (design 1):
...
3
votes
0answers
785 views
Shape inheritance hierarchy
I have managed to build an inheritance hierarchy for shape class object and I am wondering if there is a better solution to combine the following 2 hierarchies.
To begin, I have a 4 shapes classes ...
6
votes
2answers
690 views
System for registering people
For a small administrative program, I have to be able to register people and their data. But, files are sometimes created through a phone call "on the fly" and then later certain data is added to the ...
10
votes
1answer
2k views
Static Multilevel Inheritance with CRTP (Fast Intrusive Pointers)
I wanted to have a way to be able to static_cast to the proper derived type pointer of a base class to simulate a virtual call. Here the virtual call is for a ...
3
votes
0answers
156 views
Implement.js JavaScript module pattern
I have been playing with a new JavaScript module pattern to see what I can come up with. I think it's quite powerful and wanted to know if it is something people would find useful?
I'm looking for ...
2
votes
2answers
168 views
Is my code overdesigned? Does it rely too heavily on interfaces? [closed]
Context:
I am using XNA to create a simple game / learning project.
Problem:
I have three interfaces, each with a different purpose in mind. However, the way I use them, as well as their ...
9
votes
3answers
1k views
Why would I want to always have to explicitly call a “base” method if I just want to use base functionality?
I recently worked with an architect who structured his base class like this:
...
7
votes
2answers
6k views
Dispose pattern - DisposableObject
I am trying to make an universal implementation of IDisposable (as a base class):
...
1
vote
1answer
338 views
My take at OOP module/prototyping JavaScript
The last month I've been reading up on how to take my JavaScript code to the next level. I am a Java programmer at heart, so it feels nice when everything is encapsulated in classes/objects, and these ...
-1
votes
1answer
135 views
Should I use inheritance in my case? [closed]
I have 2 classes that should run a service when calling their Start method, but before it they should:
Copy items to F folder
Open S service in remote server if it'...