The object-oriented-design tag has no wiki summary.
3
votes
7answers
327 views
Design patterns: moving object references around an application
I'm new to Programmers and I am looking to increase my knowledge of programming. Recently, a user on Stack Overflow told me using singletons is a bad idea, that they encourage tight coupling and that ...
4
votes
6answers
201 views
Design: Calling back to the parent class
When modelling an object with children it's common to include the children via composition, as a member of the parent class. Sometimes however the children need to tell the parent something, they need ...
3
votes
2answers
156 views
Triggering custom events in AJAX callbacks
I'm pretty new to JavaScript, but one of the things that's been frustrating is that our AJAX callbacks have been getting packed with different functionality, making it difficult to keep everything ...
2
votes
2answers
109 views
Should these concerns be separated into separate objects?
I have objects which implement the interface BroadcastInterface, which represents a message that is to be broadcast to all users of a particular group. It has a setter and getter method for the ...
39
votes
15answers
2k views
Is it wrong to use a boolean parameter to determine behavior?
I have seen a practice from time to time that "feels" wrong, but I can't quite articulate what is wrong about it. Or maybe it's just my prejudice. Here goes:
A developer defines a method with a ...
31
votes
15answers
2k views
Is it better to return NULL or empty values from functions/methods where the return value is not present?
I am looking for a recommendation here. I am struggling with whether it is better to return NULL or an empty value from a method when the return value is not present or cannot be determined.
Take ...
6
votes
2answers
270 views
How to create the architecture/design of an application in Agile?
If I am about to develop an Enterprise application, but as far as I understand from agile process, I break features into small chunks and develop them iteratively. I used to create the database and ...
4
votes
2answers
99 views
Adapter Pattern to expose different aspects of an object — Is this a correct use?
Quite frequently, I use an Adapter-like design to expose different aspects of data objects.
For example, in a 3D modelling application I use an object hierarchy to represent the 3d models in the ...
5
votes
9answers
300 views
Populate fields or return object
What is better to do in this type of scenario: populate fields or return an object?
The situation is like this: I'm doing calculations to find the prices (inc tax, ex tax, discounted etc) of a ...
9
votes
3answers
320 views
Do I suffer from encapsulation overuse?
I have noticed something in my code in various projects that seems like code smell to me and something bad to do, but I can't deal with it.
While trying to write "clean code" I tend to over-use ...
-3
votes
4answers
105 views
Any enlightenment for understanding Object Oriented Programming? [closed]
I studied computer science near the end of 1980s, and wasn't taught OOP that formally.
With Pascal or C, when I understand the top-down design of functions, and the idea of black box, then everything ...
0
votes
1answer
111 views
How do I start correctly in building database classes in c#?
I am new in C# programming and in OOP. I need to dive into web applications for my company, and I need to do it fast and correct.
So even that I know ASP.NET MVC is the way to go, I want to start ...
2
votes
1answer
244 views
Subscribe/Publish Model in Web-based Application (c#) - Best Practices for Event Handlers
I was recently exposed to a desktop application that uses an publish/subscribe model to handle commands, events, etc. I can't seem to find any good examples of using this in a web application, so I ...
6
votes
3answers
200 views
Design in “mixed” languages: object oriented design or functional programming?
In the past few years, the languages I like to use are becoming more and more "functional". I now use languages that are a sort of "hybrid": C#, F#, Scala. I like to design my application using ...
0
votes
2answers
203 views
how should I design Objects around this business requirement?
This is the business requirement:
"
A Holiday Package (e.g. New York NY Holiday Package) can be offered in different ways based on the Origin city:
From New Delhi to NY
From Bombay to NY
NY itself ...