The object tag has no wiki summary.
2
votes
1answer
36 views
Class instance clustering in object reference graph for multi-entries serialization
My question is on the best way to cluster a graph of class instances around specifically marked objects (objects are the graph nodes and the references to each other are the directed edges of the ...
2
votes
0answers
90 views
Object Constraint Language (OCL) for Stack in java.util package
I have an exam coming up and I'm looking at past papers to get some ideas of what to expect.
I'm a bit stuck on the following one and would really appreciate if someone could give some example ...
1
vote
1answer
58 views
create function of object prototype
I am reading "Javascript : The good Parts" to improve my Javascript bases and knowledge. I was reading stuff about prototype and I encountered in this function :
var stooge = { ... }
if(typeof ...
8
votes
3answers
225 views
Is a single object to be preferred over multiple variables?
It was quite hard to put what I meant into a title, but it's easy to put into code.
C++
Is this
int offset_x = 10;
int offset_y = 40;
...
element.move(offset_x, offset_y);
To be preferred over ...
1
vote
1answer
163 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 ...
4
votes
1answer
148 views
Is it called an instance in Javascript?
Say I have a function.
function foo(){
//do stuff
}
And then I create an object of that function.
var fooObj = new foo();
What is fooObj called? An instance, An object instance, or something ...
6
votes
1answer
1k views
Design pattern for object conversion (java)
I don't use design patterns very often, besides an occasional factory and MVC, and I want to start using them more.
I have a concrete case at hand that I would like your opinion on the use of design ...
18
votes
5answers
1k 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 ...
16
votes
5answers
961 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++, ...
1
vote
1answer
178 views
javascript - would you consider 'prototype' to be the same as 'parent'
I'm learning javascript.
I see that with an object, I can use .prototype, is it fair to say that, in a class/tree hierarchy I am effectively using the 'parent' (or 'ancestor' perhaps) by doing that? ...
4
votes
3answers
650 views
Why multiple calls to same classes' Constructor from within a Constructor wouldn't work?
Please have a look at following snippet:
public class Foo {
int digit;
String name;
Foo (int d, String n) {
this(d);
// cannot do following.
//compile-time error: Constructor call must ...
2
votes
6answers
471 views
How assertive should I be in handling exceptions in objects?
I have been writing in C# 4.0 a lot lately and trying to write as lean as possible. As such, I have not been using the classic try/catch blocks and using statements as often.
I understand the general ...
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 ...
2
votes
5answers
350 views
Config Class/Struct: Pattern or Anti-Pattern? Alternatives?
If you add new configuration options to a program, it can often have tons of ripple effects in terms of getting the options to where they need to be acted upon. There are three basic ways to deal ...
7
votes
6answers
1k 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 ...