All Questions
Tagged with design-patterns inheritance
18 questions
-1
votes
1
answer
103
views
Am I overusing classes and/or OOP features? [closed]
I have a very class heavy approach to writing C++ code, which I don't think is necessarily wrong. However, I often use classes without knowing if I actually need them, which I feel leads to making ...
4
votes
1
answer
423
views
Abstract base class for binary serialization
Ensuring that some logic is always being run before the user's overriding methods.
I'm writing a library and I have some abstract classes that can be binary serialized (and users can subclass them and ...
2
votes
3
answers
322
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
2
answers
105
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
1
answer
785
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
1
answer
131
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
1
answer
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
4
answers
273
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 ...
0
votes
2
answers
422
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
0
answers
944
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
2
answers
941
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
1
answer
3k
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
0
answers
174
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
2
answers
186
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
3
answers
2k
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:
...