Search Results
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 |
Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.
3
votes
Accepted
Is inversion of control the opposite of "tell, don't ask" principle?
Your question is perhaps a bit unfocused in the sense that I can't quite identify what I could write about that would be most helpful to you, but I'll try. I know you came in with these specific two n …
5
votes
Entities vs. Services in domain driven design (DDD)
Generally speaking (and this is true outside of DDD), you want to arrange dependencies so that code depends on things that are more stable then itself. Here stable means something that changes compara …
1
vote
Composite Pattern get part of the tree
While the Composite pattern does result in a tree structure, that's not its primary motivation. It's not the one true wayTM to build a tree. It's purpose is to provide a way to treat the composite obj …
1
vote
OOP - Is this data hiding?
I agree with Martin Maat's remark that understanding the underlying reasons behind these practices will help you make sense of it all. You see, it's not so much about data hiding, it's more about stra …
8
votes
Accepted
How to avoid changing dozens of classes and interfaces when adding an argument to a method u...
Essentially, it boils down to whether or not you can come up with a useful generalized interface for the call site(s), in a way that decouples parameter passing from the actual call - by encapsulating …
2
votes
Accepted
Confusion on Single Responsibility Principle (SRP) with modem example?
I can see why you are confused as his writing presumes a little more design savviness on the part of the reader, and so is a little handwavy.
Responsibilities are dependent on the domain and on how …
4
votes
Factory pattern where some classes require additional paremeter(s)?
Think of it like this - when you first created the application Publisher create(String type) was a factory, and the design was predicated on the assumption that a single string denoting the publisher …
5
votes
Accepted
Clean Architecture - How to pass request data towards inner, domain level Use Cases?
This picture shows a generalized view of various elements that form the components and the interfaces between the layers. When I say interfaces, I don't mean the interface types (like in C# and Java, …
4
votes
How to modify object properties?
First, it's worth noting that the example in the article somewhat contrived (for practical reasons), and that context matters when it comes to these things. E.g. if you're writing a small, one-off too …
1
vote
Exposing multiple classes from the representive package for one entity
"And i am left with 4 classes for 1 "entity" in my app. If i had 10 i
would end up with 40."
Don't do that; don't follow a generic set of rules that are centered purely around creating certain struc …
23
votes
Accepted
Where should interfaces be used?
I don't think there's really a simple answer that can do a substantially better job than the statements of the principles and practices that you've already encountered.
I know you're aware of this on …
1
vote
What we called this design pattern and it is same as strategy pattern?
On its own, this is just an application of polymorphism, but you could also look at this as an incomplete Strategy pattern, with a couple of extras thrown in:
// abstract strategy type
abstract class …
1
vote
Decoupling command and receiver in command pattern
I presume from your description that all of the commands in the list refer to the same object (car). E.g., it's a small script for a car.
You don't actually need to create the commands right then when …
3
votes
Singleton's applicability clarification
This is a quote from the Go4 book, and it's the second of two points under the Applicability section ("Use the Singleton pattern when...")
This point is not really Singleton-specific; it just means t …
2
votes
Accepted
Liskov Substitution Principle Edge Case
A class doesn't violate LSP by merely having an extra method. The behaviors that LSP talks about are not methods, but rules and relationsips and constraints that the class is meant to follow/enforce a …