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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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 user 90992

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

2
votes
Getters Leak Implementation Details and Break Abstraction Consider public int millisecondsSince1970() Your clients will think "oh, this is an int" and there will be a gazillion calls assuming that i …
answered May 5 by user949300
3
votes
This is reasonable. Since you already have a Name and Type field, let's pretend this is some type of "Person" class. You might have a method person.updateFromRecentMarriageRecords(MarriageRecords) …
answered Jan 5 '18 by user949300
2
votes
While I largely agree with the suggestions to avoid constants and have a method isFoo() etc., one possible counterexample. If there are hundreds of these constants, and the calls are little used, it …
answered Jan 22 '16 by user949300
1
vote
If you want to support the nice syntax of path.remove() etc., I think you'll have to have the path have a link to it's container, ScenePath. This introduces a troublesome cyclic dependency. Whether …
answered Feb 10 '18 by user949300
3
votes
You want Composition, not Inheritance, Here's a good overview of Inheritance vs Composition. To elaborate, Inheritance represents a possible "is a" relationship. For example, if you have a Letter c …
answered Oct 10 '18 by user949300
6
votes
Trying to expand on Kasper's answer, it's easiest to rant against and eliminate setters. In a rather vague, handwaving (and hopefully humorous) argument: When would Customer.Name ever change? Seldo …
answered May 18 '15 by user949300
54
votes
No. In fact, even your "simple" code should be split into smaller parts. At least two. One to make the connection and handle the normal 200 response. For example, what if you change from a POST t …
answered Jan 25 '16 by user949300
1
vote
Have you considered a Builder pattern? The user starts with a FooGraphBuilder, with getters and setters. Calling compress() returns an immutable FooGraph, making the transition fairly clear.
answered Jan 28 '14 by user949300
2
votes
You'll get into religious wars here, but let me say that I am on the "ignore SRP" side on this one. Yes, you are coupling to a specific Serialization scheme, as correctly pointed out by @amon. But, …
answered Jan 10 '15 by user949300
0
votes
Note: This is a hack and not how "real" (ha-ha) code should be written As Bogie said to Bergman, "We'll always have toString()". Given the overly-restrictive parameters given by OP, the only solutio …
answered Mar 7 '15 by user949300
1
vote
The advice to use constructors or builders is fine in general, but, in my experience, misses some key points for Actions, which Possibly need to be internationalized Are likely for marketing to chan …
answered Aug 7 '14 by user949300
0
votes
Flyweight pattern is the right idea. I found this older Stack Overflow post about the Boost Flyweight Library that might fit your needs. I'm not much of a C++ user and have never used it, so use at …
answered Dec 1 '13 by user949300
8
votes
All too often the Single Responsibility Principle becomes a Zero Responsibility Principle, and you end up with Anemic Classes that do nothing (except setters and getters), which leads to a Kingdom of …
answered Dec 7 '13 by user949300
16
votes
I agree with the other responses that this is generally bad practice. There is one specific case where I find passing an Object may be superior: when you are eventually dealing with Strings, e.g. if …
answered May 14 '13 by user949300
1
vote
The D part of SOLID says "Abstractions should not depend on details. Details should depend on abstractions." So, between Page and Renderer, which is more likely to be a stable abstraction, less like …
answered Feb 7 '18 by user949300

15 30 50 per page