Questions tagged [object]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
60 votes
8 answers
15k 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 ...
honestduane's user avatar
85 votes
14 answers
14k views

Do objects in OOP have to represent an entity?

Does an object have to represent an entity? By an entity I mean something like a Product, Motor, a ParkingLot etc, a physical, or even a clear-cut non-physical conceptual object -- something that ...
Dennis's user avatar
  • 8,217
4 votes
3 answers
5k views

Arrays vs Objects in view template

I am wondering, in view templates, what would contribute to me choosing between using arrays or objects for getting things printed out in arrays {{$user->zip_code}} vs {{$user['zip_code']}} I'm ...
Damon's user avatar
  • 175
4 votes
5 answers
4k views

Why is there no deterministic object destruction in Java? [duplicate]

I understand and enjoy the benefits of the Garbage Collection in Java. However I don't understand why there is no way in Java to explicitly (and quickly) destroy an object. Surely this could be useful ...
Aviv Cohn's user avatar
  • 21.4k
3 votes
1 answer
318 views

Object creation based on type from parallel hierarchy without instanceof (Java)

I have two parallel hierarchies: B and C implement interface A D and E extend the abstract class F I want to be able to do: F f = createObject(A a) where createObject should follow the behaviour: ...
andfor's user avatar
  • 141
1 vote
4 answers
671 views

Is collection object better being immutable? [closed]

As per this link, it is an advice that: A good object should never change his encapsulated state. Remember, an object is a representative of a real-life entity, and this entity should stay the same ...
overexchange's user avatar
  • 2,265