The Stack Overflow podcast is back! Listen to an interview with our new CEO.
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 12828

Questions about problem solving and planning for a solution through software design.

3
votes
While coding, I came across a realization that I am not creating 'loose coupling'. The way I am trying to solve the problem right now is creating an instance of the Log Collector Class in MAIN and …
answered May 24 '12 by pdr
13
votes
As you've identified, saveUser(User user) couples the two classes. This is not always bad. If the sole purpose of class B is to save a User then it's fair enough for it to expect a User object to save …
answered Sep 30 '13 by pdr
0
votes
I used to do this about 5 years ago. From memory, we had Event - a sporting event, be it a horse race or a football match Market - anything you can bet on within an event (to win, placed, number of …
answered Jul 13 '11 by pdr
2
votes
That's a pretty good approach. You can have as many objects as you like raising exceptions, informing your middle-man, and as many listeners as you like waiting for an event to be raised. And no objec …
answered May 24 '12 by pdr
2
votes
I don't think I've ever said this before, but this looks like a prime candidate for the Visitor pattern. the visitor design pattern is a way of separating an algorithm from an object structure on …
answered Feb 26 '12 by pdr
5
votes
ISP is an interesting principle because the benefits (or rather the costs of ignoring it) are generally small, but the cost of implementation is also small. The kind of problem that might occur is if …
answered May 22 '13 by pdr
2
votes
signals. You will find very quickly that you have classes where there is nothing to test. When you find those, rethink your design, you probably don't need that class. On the other hand, you'll also … find code where you feel you are swimming in treacle while trying to write the tests. Again, rethink your design, it probably needs an abstraction layer you don't have yet. In other cases, you'll …
answered Sep 16 '11 by pdr
5
votes
Ideally, the UI shouldn't know about your business objects directly. It should know what it has to display and where to send any submission. The receiver of the submission should know how to process t …
answered Feb 6 '14 by pdr
1
vote
Like any programming language, it's just a representation of an Abstract Syntax Tree. Any approach that you can use to represent a tree can be used to represent a program. Interconnecting blocks like …
answered Feb 10 '13 by pdr
3
votes
I think you're right, to be honest. I think that Microsoft messed up with the StreamWriter class, specifically, for the reasons you describe. However, I've since seen a lot of code where people don't …
answered Jan 11 '12 by pdr
0
votes
Not necessarily. If you make something reusable that is clearly never going to be reused then that's bad design. For example, if you are writing a file full of data which is unique to your company … and that data is to be imported once to somewhere else, why bother making it reusable? That said, if your framework doesn't have one already, the code to write to a file may need to be reusable. That would be good design. …
answered May 11 '11 by pdr
34
votes
they are good guidelines when you're lost. Test Driven Development made more of an improvement to my OO design skills than anything else I've ever learned. You will not be your best until you've gone … and blogs but take nothing as gospel. This industry still hasn't found, and may never find, a perfect path. By all means learn design patterns, but don't look for places to use them, simply use them as a facilitator to communication. Hope some of that helps. …
answered Jul 26 '11 by pdr
2
votes
A class adapter IS a subclass, so you certainly shouldn't use it to adapt multiple subclasses. Even assuming that multiple inheritance is available in your language of choice, this would create an unm …
answered May 15 '14 by pdr
261
votes
For my money, I think everyone's missing the point of design patterns. It's rare that I sit wondering which pattern I should use in a given situation. Also, I was using most of those patterns long … before I knew they had names. The power of design patterns is in communication. It is much quicker for me to say "use a Strategy for that" than to describe in detail what I am suggesting. It is much …
answered Apr 24 '11 by pdr
5
votes
It doesn't have to be, no. One example I can think of is in the .NET Framework in System.Net.WebRequest.Create(). It will return an object of a class derived from WebRequest, based on the protocol pa …
answered Apr 10 '13 by pdr

15 30 50 per page