Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 21172

A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner

3 votes

Avoiding instanceof vs abstract God Class. Do I have an alternative?

It's reasonable to use an instanceof test in filtering, because the logical scope of the filter is outside the behavior of the class. Let's start with what I hope is an uncontroversial example: the e …
kdgregory's user avatar
  • 5,290
3 votes

What are the benefits of using a 'decorator factory' that decorates objects?

First, MichaelT's comments are spot-on. And there's absolutely no reason to create an AbstractDecorator class. That said, here is an example of a "decorator factory": the factory determines, based on …
kdgregory's user avatar
  • 5,290
10 votes
Accepted

What are the responsibilties of the main in object oriented programming?

First off, your example isn't an object-oriented program. It's a procedural program that happens to store data in objects, because that's the tool that your language (Java?) provides for structured da …
kdgregory's user avatar
  • 5,290
3 votes

Legitimate cases of having .equals() behaving inconsistently with .compareTo()?

The "legitimate reason" for having equals() inconsistent with compareTo() is if they serve different real-world purposes. Let's start with BigDecimal. If you're simply sorting a list of values, you p …
kdgregory's user avatar
  • 5,290