class-design Questions
2
Solved
I've been developing a few mobile games, in which those games fetch their data from a server-database.
I'm used to storing "type" values as an integer identifier, and an enum in the client to iden...
Mantic asked 15/2, 2013 at 10:46
4
Solved
I have a domain model that is trivially represented by the following.
IMyInterface
ClassA : IMyInterface
ClassB : IMyInterface
What I want is to implement IEquatable in such a way that I can w...
Beveridge asked 30/9, 2009 at 15:18
4
Solved
In java adjectives ending in -able are interfaces Serializable, Comparable etc... So why is Throwable a class? Wouldn't exception handling be easier if Throwable were an interface? (Edit: e.g. Exce...
Levy asked 23/5, 2010 at 0:45
1
Solved
In my class I have these setters/getters:
public int Id { get; set; }
public String ProjectName { get; set; }
public String ProjectType { get; set; }
public String Description { get; set; }
public...
Coheir asked 11/7, 2012 at 13:23
7
Solved
I have a bit of a theoretical question, however it is a problem I sometimes face when designing classes and I see it done differently when reading others code. Which of the following would be bette...
Viola asked 4/7, 2012 at 15:42
2
Solved
I recently wrote a class library that includes some objects that model certain types of files. For example, there is an abstract Document class, with derived classes PdfDocument (concrete) and Offi...
Reproduction asked 2/7, 2012 at 16:5
8
Solved
Does anybody use the Class Designer much in Visual Studio?
I have downloaded the Modeling Power Toys for 2005 and have been impressed with what I've seen so far. The MSDN Class Designer Blog doesn...
Edyth asked 18/8, 2008 at 9:51
6
Solved
As the title suggests I would like to understand why static classes can have only static members. I hope it is same in all the programming languages. So the explanation would be the same for all th...
Draff asked 11/12, 2010 at 6:44
11
Solved
I’m having trouble understanding how classes relate to their methods. Is a method something that the object does, or something that’s done to it? Or is this a different concept entirely?
Spe...
Rosmunda asked 26/4, 2012 at 5:47
4
Solved
Imagine we have some sort of protocol with hundreds of message types, each of which we want to model by a C++ class. Since each class should be able to process each field automatically, a natural s...
Boathouse asked 27/3, 2012 at 20:20
2
Solved
I'm quite new to PDO and also OOP with PHP in general so please be nice :) Basically I'm trying to make a connection object based on PDO so that I can have one connection that I call throughout my ...
Odyssey asked 15/3, 2012 at 20:18
4
Solved
Q1.
In my university studies of object-oriented modelling and design they recommend thinking about what an object can do for its method, and what its responsibilities are for its attributes. All at...
Ru asked 24/10, 2010 at 22:0
6
Solved
Does it make sense to implement the copy-assignment operator in a class with all const data members?
Imagine I have a class used to represent some trivial numerical data, like a vector. I want this class to be immutable in terms of its members, but still support correct copy-assignment behaviour.
...
Whacking asked 7/9, 2010 at 12:57
1
Solved
I came across this code in ShareKit, and I don't understand what the writer had in mind, using self in a class method. There is a warning: Incompatible pointer types sending 'Class' to parameter ty...
Gustav asked 27/1, 2012 at 3:14
2
Solved
I'm designing a class that has two dependencies. One of the dependency classes has been written and tested. The other has not yet been written.
It has occurred to me because the remaining dependen...
Apotheosize asked 18/1, 2012 at 9:24
4
How would I design classes say in c# to represents a database model?
Given the following tables and fields for a database,
Table: Employee
Pk EmpID
Lname
Fname
Adress
Fk DeptID
Table: Depar...
Jaime asked 6/7, 2011 at 23:25
2
Solved
I have a user control created in xaml, lets name it "View". In the View.xaml.cs I changed the access modifier for the class View to internal:
internal partial class View : ViewBase { ... }
After...
Jefferyjeffie asked 18/10, 2010 at 8:36
3
Solved
If you needed to rewrite the following C++ code in D, how would you do it?
struct A{
const S* _s;
B _b;
C _c;
mutable C _c1, _c2;
A(const B& b, const C& c, const S* s){ /*...*/ }
...
Thinner asked 30/12, 2011 at 5:36
2
Lets face it writing nice toString messages is a boring messy chore that needs to be done as it can really be helpful for insepection in a debugger or logging.
What features do you like or w...
Gytle asked 21/1, 2011 at 6:7
6
Solved
Sometimes it's necessary to prohibit a copy constructor in a C++ class so that class becomes "non-copyable". Of course, operator= should be prohibited at the same time.
So far I've seen two ways t...
Falsify asked 18/4, 2011 at 11:22
4
Solved
using C# I have a class which contains among other meta information the root node of a directed graph. Let's call this the Container-Class. This container can appear in two different modes, Editor-...
Cubeb asked 4/11, 2011 at 10:35
5
Solved
I'm designing a namespace to hold a set of classes that will handle user related tasks for a several different applications. (Log-in, authenticate etc)
The problem is the namespace will be called ...
Caracal asked 26/11, 2009 at 13:44
3
Solved
I've noticed a variety of @interface declarations for Objective-c classes. I'd like to understand why developers declare @interface in the following ways:
// in the .h file
@interface MyClass : NS...
Riancho asked 12/10, 2011 at 18:44
1
Solved
First an example to discuss:
class Foo
{
// Attributes:
int attribute1, attribute2;
// Methods:
virtual void Foo1()
{ /* With or without Implementation */ }
virtual void Foo2()
{ /* Also w...
Merras asked 4/10, 2011 at 19:41
6
Solved
I have a User class. One of the properties needs to be an "associated" user, so it's type needs to be User. Right now when I initialize the class, I get a stack overflow when it tries to initialize...
Phew asked 30/9, 2011 at 15:15
© 2022 - 2024 — McMap. All rights reserved.