The class tag has no wiki summary.
-1
votes
0answers
45 views
How do I have a user cin an integer and convert it to binary so that the appropriate 0's and 1's are stored in a vector? [closed]
I'm trying to create a BinaryInteger class that mimics the way integers are stored in a computer, but which represents negative numbers in the ‘sign and magnitude’ form (i.e., the binary ...
0
votes
1answer
106 views
PHP function types
I am trying to find a way of classifying different types of PHP functions. For example that fopen, fwrite, fclose and so on are all part of IO, and the MySQL functions and MySQLi class is all for ...
-3
votes
0answers
34 views
How to create an Android Class with view elements as attributes? [closed]
05-08 11:03:57.030: E/AndroidRuntime(3933): FATAL EXCEPTION: main
05-08 11:03:57.030: E/AndroidRuntime(3933): java.lang.IllegalStateException: Could not execute method of the activity
05-08 ...
0
votes
0answers
108 views
Why does my property have a line through it on intellisense? [migrated]
When i access a property through intellisense, sometimes it has a line through it like so :
Why is this happening? is it deprecated?
0
votes
1answer
179 views
Teaching `class`es and objects in C++ to university students
To learn classes and objects at my university, students are required to develop a simple game (nine-mens morris or something similar) using Java. Java is used because of its libraries and tool ...
1
vote
1answer
130 views
Analogy of a class being a cookie cutter and objects being cookies
I came across the analogy of the class being a cookie cutter and the cookies being objects while reading Code Complete. I fail to see why this analogy was drawn.How is it related to the concept of ...
1
vote
3answers
347 views
Legitimate reasons for circular references in C++
I have project written in C++ that I am working on which has a parent-child relationship where each child has only one parent. I had previously decided after looking at this post that I would make the ...
1
vote
1answer
45 views
Do I include association links for Objects that only have method scope in UML class diagrams
For example I have a utility Class which contains a few constants (GCMConstants), this class is used in one method in the application. However as it is not a member of the Class it should not be ...
1
vote
1answer
115 views
Do I include third party classes in my UML class diagrams
I'm developing a system which involves 2 Android applications and a Java web application. For my UML class diagrams I have not included third party classes I use e.g. observer type interfaces. Should ...
8
votes
3answers
625 views
How to avoid “managers” in my code
I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it ...
-3
votes
2answers
79 views
naming abstract class [closed]
I have an abstract class representing a test assertion. How should I name it and why?
Assertion
AssertionBase
AssertionAbstract
[other]
5
votes
5answers
511 views
Why Java does not allow function definitions to be present outside of the class?
Unlike C++, in Java, we cannot have just function declarations in the class and definitions outside of the class. Why is it so?
Is it to emphasize that a single file in Java should contain only one ...
4
votes
1answer
101 views
Advices on structure and names for namespaces and classes
I'm resistant to calling the "main" class the same as the namespace, but I sometimes find myself needing it. Considering I'm using the Vendor.Namespace.[Subnamespace].Class formula, imagine this ...
2
votes
3answers
724 views
Functions returning pointers
C++ noob here. I have a very basic question about a construct I found in the C++ book I am reading.
// class declaration
class CStr {
char sData[256];
public:
char* get(void);
};
// ...
30
votes
5answers
9k views
When do you use a struct instead of a class?
What are your rules of thumb for when to use structs vs. classes? I'm thinking of the C# definition of those terms but if your language has similar concepts I'd like to hear your opinion as well.
I ...
8
votes
2answers
225 views
Refactoring several huge C++ classes / methods. How to start? [duplicate]
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count ...
-2
votes
1answer
312 views
Don't Use Static? [duplicate]
Possible Duplicate:
Is static universally “evil” for unit testing and if so why does resharper recommend it?
Heavy use of static methods in a Java EE web application?
I ...
55
votes
8answers
3k views
Don't Use “Static” in C#?
I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use "static". You can't write automated tests with static ...
16
votes
4answers
9k views
Why and when should I make a class 'static'? What is the purpose of 'static' keyword on classes?
The static keyword on a member in many languages mean that you shouldn't create an instance of that class to be able to have access to that member. However, I don't see any justification to make an ...
1
vote
1answer
138 views
Is there a good design pattern for this messaging class?
Is there a good design pattern for this?
I want to create a messaging class.
The class will be passed:
the type of message (eg. signup, signup confirmation, password reminder etc)
the client's id
...
8
votes
7answers
693 views
Is it appropriate for a class to only be a collection of information with no logic?
Say I have a class Person that has instance variables age, weight, and height, and another class Fruit that has instance variables sugarContent and texture. The Person class has no methods save ...
18
votes
5answers
994 views
How do I prove or disprove “god” objects are wrong?
Problem Summary:
Long story short, I inherited a code base and an development team I am not allowed to replace and the use of God Objects is a big issue. Going forward, I want to have us re-factor ...
0
votes
4answers
248 views
Practical Usage Of Structures in c# [duplicate]
Possible Duplicate:
When do you use a struct instead of a class?
While working in OOPs, we always battle around structures and classes.
But in real world, we always sticks to classes. I ...
0
votes
1answer
280 views
Class Design and Structure Online Web Store
I hope I have asked this in the right forum.
Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so ...
-3
votes
8answers
1k views
Why do we need to separate classes which have different functionality? [closed]
Why do we need to separate classes which have different functionality? For example, why should we separate a car class from a paint class. What would be the OOD concept behind this? Is there anything ...
2
votes
1answer
356 views
What is meaning of the term “Sans” in a class name?
I was reading code of a java project where I found a class name like "UserSansXml". This class is dealing with user objects. I wanted to know the meaning of "sans".
16
votes
5answers
928 views
Why am I seeing so many instantiable classes without state?
I'm seeing a lot of instantiable classes in the C++ and Java world that don't have any state.
I really can't figure out why people do that, they could just use a namespace with free functions in C++, ...
2
votes
3answers
497 views
Is there any Common Name for Edit,Save,Delete,Select
Can anyone suggest me a Common Name for Edit,Save,Delete,Select
I want to create a Interface in C#, which will support all these methods.
My Context is :
I am developing an Invoice Application in ...
5
votes
5answers
999 views
What do you call classes without methods?
What do you call classes without methods?
For example,
class A
{
public string something;
public int a;
}
Above is a class without any methods. Does this type of class have a special name?
8
votes
4answers
812 views
Return interface or class
Suppose I have a method
public List<User> GetBatchOfUsers(IEnumerable<int> userIDs)
{
List<User> users = new List<User>();
// some database stuff
return users;
}
...
1
vote
1answer
84 views
How to represent association in programs [closed]
Could someone help me in implementing association in cpp. I am trying to implement a dice game where I have two classes a diegame and a dice.
0
votes
2answers
432 views
Should I create specific classes for JSON Objects or only use the container(Array/Dictionary) for accessing Data?
I'm using Foursquare to get a List of Restaurants nearby inside an iOS app. The Result is stored in an Array which consists of Dictionaries and regarding how deep the Data is, each Dictionary contains ...
37
votes
11answers
4k views
Why is it good to split a program into multiple classes?
I'm still a student in high school (entering 10th grade), and I have yet to take an actual computer course in school. Everything I've done so far is through books. Those books have taught me concepts ...
4
votes
3answers
597 views
Is this the correct approach to an OOP design structure in php?
I'm converting a procedural based site to an OOP design to allow more easily manageable code in the future and so far have created the following structure:
/classes
/templates
index.php
With these ...
-1
votes
1answer
356 views
What is the difference between class level attributes, Class constants and singleton methods?
What the difference given they all exist 'once per class'.
When should I use one over another, i.e. for what purpose?
I use Ruby.
0
votes
2answers
493 views
Is it best practice to always capitalize class file names in PHP, and other languages?
I ask because I've seen a couple of OO PHP tutorials which do not adhere to this, but to me it just makes sense. It makes it easy to instantly see if a file is a class or not, if non-class files all ...
11
votes
7answers
3k views
What are the roles of singletons, abstract classes and interfaces?
I am studying OOP in C++ and, even though I am aware of the definitions of these 3 concepts, I cannot really realize when or how to use it.
Let's use this class for the example:
class Person{
...
8
votes
4answers
291 views
Origin of structures and classes
What design and implementation issues did programmers have to solve when they decided first to use structures and classes?
When did this happened and who were the pioneers behind these ideas?
Note, ...
0
votes
2answers
273 views
Identify name of class which does CRUD operations
Using my application (which I am currently developing), Admin can assign addresses (not only assign, it is something like CRUD operations) to salesRep, so that those addresses will be listed under ...
0
votes
1answer
251 views
How do I start correctly in building database classes in c#?
I am new in C# programming and in OOP. I need to dive into web applications for my company, and I need to do it fast and correct.
So even that I know ASP.NET MVC is the way to go, I want to start ...
1
vote
3answers
258 views
Any language where every class instance is a class too?
Taking inspiration from Javascript prototypes, I had the idea of a language where every instance can be used as a class.
Before I potentially reinvent the wheel, I would like to ask if there is a ...
4
votes
2answers
173 views
How to deal with variables when extracting methods in to smaller methods?
This is an abstract question to clarify a refactoring concept in the ruby language. Assume in the real world that there would be many more variables and method in the Furniture Class and Refinish ...
2
votes
2answers
323 views
GUI architecture and class naming advice
Problem:
I'm working on coding a few light-weight touch-tablet games and often get stuck with difficulties naming my user interaction/interface classes and their relationships with each other ...
10
votes
3answers
2k views
Where should I put functions that are not related to a class?
I am working on a C++ project where I have a bunch of math functions that I initially wrote to use as part of a class. As I've been writing more code, though, I've realized I need these math functions ...
3
votes
2answers
669 views
How to name a private method in a language which doesn't support privacy?
What's the coding standard for naming a private method in a language which does not have the private modifier? Specifically, I am talking about Javascript. Below I've placed an underscore at the end ...
8
votes
5answers
511 views
Python: What is the point of using “import”?
I am not very clear on this aspect. Let's say you have a bunch of .py files that are their own separate modules.
Why does each .py file need to import the others when they use that class? Or do they? ...
2
votes
2answers
108 views
Would be semantically correct to make a “Login” constructor in an api class?
Since the methods of the class will only work if the user is logged in, is it right or is there some problem that might make my code slow/inneficient?
6
votes
3answers
387 views
C++ XML Parsing: Suggestions on Approach for Parsing and Storing data
I am looking into developing a C++ application to parse xml (using the rapidxml framework), and I would like some advice on how to approach this.
The file I want to parse is a XML game file that ...
0
votes
2answers
582 views
Is this a correct way to use nested classes to keep track of data?
I have some instruments. Each instrument should have a name (string) and description (string).
Each instrument can have some setups, which these setups are each a series of commands(string[] or ...
7
votes
4answers
314 views
Is there a standard, formal name for an object or class that behaves as if it is a given object?
I have an app in Django that expects to get a record with the fields email, first_name, and last_name.
However, sometimes I want to be able to send it something that isn't actually a record but ...
