class-design
Setting default value for properties of Interface?
I have an Interface which contains one property. I need to set the default value for that property. How to do that?. Also is it good practice to have a default value for a property in Interface? or he[详细]
2023-04-12 22:29 分类:问答Sharing a variable between a class and its member
If you have a class that contains a state variable and two member classes t开发者_如何学Chat need access to it and operate asynchronously. What is the best way to implement this?[详细]
2023-04-12 13:54 分类:问答Varieties of @interface declarations, some with parentheses
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:[详细]
2023-04-12 09:23 分类:问答Browsing existing open source projects to learn/improve class design and design patterns
I was thinking of looking into some open source projects to find examples of class design, design patterns, and maybe even some AI / algorithm stuff.[详细]
2023-04-10 13:15 分类:问答Is there a way to design two classes that privately manipulate each other's data?
Background: I\'m writing a C++ wrapper interface for a C library not written by me. My wrapper classes mimic the library structs, and in this library, some members of struct b point to members of stru[详细]
2023-04-10 11:57 分类:问答Initializing a new class in its own constructor
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[详细]
2023-04-09 22:35 分类:问答Decomposing big member function
Decomposing a member function In a class there is a member function that is rather long. Let\'s say we have[详细]
2023-04-08 18:50 分类:问答C# class design issue for mongodb
I got a problem in C# class design for mongodb, suppose there two class: public class Group { public Group()[详细]
2023-04-05 21:30 分类:问答defining Function on individual enum constants
one of my class has enum as one of its properties and the definition of the class looks like this: public class A[详细]
2023-04-04 20:10 分类:问答Class hierarchy of tokens and checking their type in the parser
I\'m attempting to write a reusable parsing library (for fun). I wrote a Lexer class which generates a sequence of Tokens. Token is a base class for a hierarchy of subclas开发者_StackOverflowses, eac[详细]
2023-04-04 06:29 分类:问答