The tag has no wiki summary.

learn more… | top users | synonyms (1)

1
vote
1answer
76 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
196 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 ...
11
votes
3answers
2k 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 ...
7
votes
8answers
3k 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 ...
3
votes
1answer
166 views

Advices on structure and names for namespaces and classes [closed]

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 ...
8
votes
2answers
609 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 ...
1
vote
1answer
199 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
730 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 ...
0
votes
4answers
341 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 ...
33
votes
6answers
3k views

How do I prove or disprove “god” objects are wrong?

Problem Summary: Long story short, I inherited a code base and a 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
1answer
936 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 ...
2
votes
1answer
380 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
1k 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
2k 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); }; // ...
2
votes
3answers
875 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 ...
-3
votes
8answers
2k 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 ...
64
votes
9answers
14k 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 ...
6
votes
5answers
2k 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
2k 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
105 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.
1
vote
2answers
580 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 ...
41
votes
11answers
8k 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 ...
-1
votes
1answer
623 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
2k 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 ...
8
votes
4answers
324 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, ...
14
votes
7answers
6k 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{ ...
0
votes
1answer
466 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
268 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
236 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
433 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 ...
16
votes
3answers
6k 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 ...
4
votes
2answers
2k 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 ...
2
votes
2answers
123 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?
4
votes
3answers
1k 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 ...
8
votes
5answers
640 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? ...
0
votes
2answers
2k 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
338 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 ...
6
votes
3answers
584 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 ...
1
vote
1answer
134 views

Learning in the Classroom

I am currently taking an Assembly programming class, and I honestly find it extremely boring and tedious. While I've programmed some assembly before as part of a C++ program, I find what we are doing ...
26
votes
4answers
27k 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 ...
7
votes
6answers
3k views

Is it called class or object instance?

I have a wording / precision question. Sometimes I write "object instance" sometimes "class instance". Isn't it that an object is always an instance of a class? Therefore "object instance" is not the ...
2
votes
3answers
320 views

Want to know performance issues of Class types & access modifiers

Someone suggested me to mark classes as SEALED that are not being inherited anywhere. I was using default style and was not concerned with the type of class. At present I don't have a benchmark tool ...
0
votes
2answers
236 views

Name for this pattern?

I'm writing a class that will handle thread synchronisation. It would have a begin method which would increment a counter and an end method that would de-increment a counter. It'll have another ...
50
votes
5answers
25k 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 ...
4
votes
2answers
810 views

Smart Pointers inside class vs Normal Pointers with Destructor

Regarding pointers which are members of classes. Should they be of a smart pointer type or is it enough to simply deal with them in the destructor of the class they are contained in?
3
votes
2answers
1k views

Should I use a Class or Dictionary to Store Form Values

I am working on a C# .NET Application, where I have a Form with lots of controls. I need to perform computations depending on the values of the controls. Therefore, I need to pass the Form values to a ...
11
votes
4answers
756 views

Nested Classes: A useful tool or an encapsulation violation?

So I'm still on the fence as to whether or not I should be using these or not. I feel its an extreme violation of encapsulation, however I find that I am able to achieve some degree of encapsulation ...