class-design Questions
5
Solved
Lets say I have a main window with a slider and a widget inside that window with a method called setValue(int). I'd like to call this method every time the value of the slider has changed.
Is ther...
Manufacturer asked 19/2, 2014 at 23:56
2
Originally I had thought about designing a ThreadManager class to store threads along with the data type objects and function type objects that they would work with. The class was to be responsible...
Decolorize asked 22/3, 2018 at 23:13
1
Solved
Well it was harder then I thought but I figured out how to encapsulate my code using a namespace
I already know how to do it with a class (I’m coming from C# world)
And for the question, I had a...
Sixteenth asked 17/1, 2018 at 17:46
9
Solved
Working on a little Ruby script that goes out to the web and crawls various services. I've got a module with several classes inside:
module Crawler
class Runner
class Options
class Engine
end
...
Testudinal asked 27/5, 2009 at 19:23
10
Solved
I am starting a new project from the ground up and want it to be clean / have good coding standards. In what order do the seasoned developers on here like to lay things out within a class?
A : 1) ...
Stellular asked 19/11, 2009 at 4:22
24
Solved
I'm at a point in my development learning where I feel like I must learn more about interfaces.
I frequently read about them but it just seems like I cannot grasp them.
I've read examples like: A...
Calvo asked 14/1, 2009 at 19:3
5
Why do common collection classes in Objective C like NSString, NSArray, NSDictionary etc have a mutable as well as an immutable version. What is the logic behind defining them separately? Performan...
Hypotaxis asked 4/7, 2011 at 1:54
13
Solved
I want a simple class that implements a fixed-size circular buffer. It should be efficient, easy on the eyes, generically typed.
For now it need not be MT-capable. I can always add a lock later, ...
Dardar asked 26/2, 2009 at 11:2
2
Solved
I have a case there I need to execute set of validation rules for different companies. There will be multiple validation rules against one Company.
So I have following table Structure
Company
...
Strephonn asked 7/2, 2017 at 9:1
5
Solved
Recently I Attended an interview. This question was asked.
This is the scenario.
We have two type of employees. Regular and contract employee.
Regular employees will be paid on a fixed basis at ...
Sempstress asked 28/3, 2011 at 9:46
3
Solved
I thought I'll post this to the community. I am using coredata, and have two entities. Both entities have a hierarchical relationship. I am noticing quite a lot of duplicated functionality now, and...
Hood asked 26/5, 2011 at 16:44
1
Solved
What are the best practices to avoid code duplication when implementing class pairs such as iterator and const_iterator or similar?
Does one usually implement iterator in terms of const_it...
Hyssop asked 8/11, 2016 at 13:39
7
Solved
I read the Cwalina book (recommendations on development and design of .NET applications).
He says that a good designed struct has to be less than 16 bytes in size (for performance purposes).
Why ...
Merridie asked 9/3, 2010 at 8:56
2
I noticed recently that Exception has several constructors which take Throwable as a parameter. Throwable has two subclasses, Error and Exception, and generally all documentation indicates that you...
Vmail asked 4/5, 2016 at 17:39
14
Solved
I seldom use inheritance, but when I do, I never use protected attributes because I think it breaks the encapsulation of the inherited classes.
Do you use protected attributes ? what do you use th...
Shrovetide asked 16/9, 2008 at 19:48
4
Solved
I would like your guidance on how to create classes and their relationships (generalization, association, aggregation and composition) accurately from my USE case diagram (please see below).
I am...
Notum asked 12/3, 2010 at 7:1
4
Solved
I'm a beginner-intermediate self taught Python developer,
In most of the projects I completed, I can see the following procedure repeats. I don't have any outside home code experiences, I think t...
Seringa asked 1/10, 2015 at 10:53
6
Let's say I want to make some sort of engine which should support loading graphical Images, so I have
struct Image;
Image* load_image_from_file(...);
I don't want external world to know what I...
Infant asked 10/5, 2015 at 14:30
7
Solved
I watched a talk by Douglas Crockford on the good parts in Javascript and my eyes
were opened. At one point he said, something like, "Javascript is the only language where good programmers believe ...
Parrotfish asked 27/11, 2009 at 17:38
7
I'm new to the concept of object oriented programming (in java) and I often encounter the following design problem:
I often create classes with instance variables which are not known at the moment...
Carlist asked 20/4, 2015 at 10:16
7
Solved
I'm contemplating two different class designs for handling a situation where some repositories are read-only while others are read-write. (I don't foresee any need for a write-only repository.)
...
Quibbling asked 10/5, 2010 at 18:15
7
Solved
For some time I've been designing my class interfaces to be minimal, preferring namespace-wrapped non-member functions over member functions. Essentially following Scott Meyer's advice in the artic...
Kinakinabalu asked 28/9, 2010 at 22:15
1
Solved
As part of a system design, we need to implement a factory pattern. In combination with the Factory pattern, we are also using CRTP, to provide a base set of functionality which can then be customi...
Barracuda asked 14/3, 2015 at 18:7
16
Solved
I'm currently modifying a class that has 9 different constructors. Now overall I believe this class is very poorly designed... so I'm wondering if it is poor design for a class to have so many cons...
Draughtsman asked 29/1, 2009 at 6:29
2
Solved
There is a Checkstyle rule DesignForExtension. It says: if you have a public/protected method which is not abstract nor final nor empty it is not "designed for extension". Read the description for ...
Naif asked 19/3, 2009 at 15:18
© 2022 - 2024 — McMap. All rights reserved.