Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.

learn more… | top users | synonyms

2
votes
1answer
533 views

Sanity of design for my in-memory object representations of database rows

I've been trying to revise the structural design of the C#.NET-based system I'm currently working on. The new design involves a rather light-weight object-relational mapping framework (we're trying ...
3
votes
2answers
590 views

What are some good small-scale refactoring tests?

I'm looking to test potential candidates on their ability to develop concise, reusable code. I feel like a good test of that skill would be to give them a very small scale application or class ...
10
votes
7answers
1k views

What are the features required for Object Orientation?

I am just wondering, what exactly are the features a language or a library must provide in order for it to be defined as 'Object Oriented'. Is Object Orientation something that can, more or less, be ...
22
votes
17answers
2k views

What is the value in hiding the details through abstractions? Isn't there value in transparency?

Background I am not a big fan of abstraction. I will admit that one can benefit from adaptability, portability and re-usability of interfaces etc. There is real benefit there, and I don't wish to ...
6
votes
10answers
482 views

Teaching Classes and Objects

I'm trying to teach how an object is just an instance of a class to a buddy of mine. However, he doesn't seem to understand it so well. I've heard a ton of the examples (blueprint to a house, etc.) ...
22
votes
10answers
2k views

How would Functional Programming proponents answer this statement in Code Complete?

On page 839 of the second edition, Steve McConnell is discussing all the ways that programmers can "conquer complexity" in big programs. His tips culminate with this statement: "Object-oriented ...
0
votes
1answer
417 views

Wrapping a 3rd party API - Gateway Pattern connections

Given a 3rd party API with a very cumbersome object with many different responsibilities-- we decide to wrap using small, manageable, single-responsibility objects. This is the gateway pattern (I ...
3
votes
3answers
351 views

Is partial classes modern Subject-Oriented programming?

Important discussion follows: C# and other language have made partial classes more popular. But isn't this really a tool that have reinvented the subject-orientated programming wheel? What do you ...
17
votes
3answers
13k views

Best design for Windows forms that will share common functionality

In the past, I have used inheritance to allow the extension of Windows forms in my application. If all of my forms would have common controls, artwork, and functionality, I would create a base form ...
6
votes
3answers
6k views

Practical size limits of a Hashtable and Dictionary in c#

What are the practical limits for the number of items a C# 4 Dictionary or Hashtable can contain and the total number of bytes these structures can reasonable contain. I'll be working with large ...
56
votes
16answers
19k 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 ...
2
votes
1answer
527 views

Dependency Injection: Only for single-instance objects?

What if I want to also decouple my application, from classes like Product or User? (which usually have more than one instance) Take a look at this example: class Controller { public function ...
10
votes
7answers
3k views

OO best practices for C programs

"If you really want OO sugar - go use C++" -- was the immediate response I got from one of my friends when I asked this. I know two things are dead wrong here. First OO is NOT 'sugar', and second, C++ ...
5
votes
2answers
232 views

What defines an encapsulation properly?

I find the encapsulation concept a bit confusing. So far I have read that the members of the class should be private and any access to private members must be through getter and setter methods, which ...
7
votes
4answers
545 views

What books or resources would you recommend to learn practical OO design and development concepts? [closed]

I'm a self taught programmer; I understand the foundations of programming and what classes are, but my code tends to be messy with class methods interacting with a half a dozen other classes, and my ...
8
votes
2answers
283 views

When following SRP, how should I deal with validating and saving entities?

I've been reading Clean Code and various online articles about SOLID lately, and the more I read about it, the more I feel like I don't know anything. Let's say I'm building a web application using ...
7
votes
4answers
3k views

Can I consider interface methods as abstract methods?

I was thinking about that, and I had some doubts. When I declare an interface, for example: public interface MyInterface { public void method1(); public void method2(); } Could these ...
5
votes
1answer
121 views

Checking members and instantiating in properties

Consider this: public MyClass { private Resource _myResource; public Resource MyResource { get { if(_myResource == null) { ...
7
votes
3answers
564 views

Long parameter list versus long state variable list

In a C++ book, the author says we no longer need a function with a long parameter list because most of the parameters can be refactored into state variables in a class. On the other hand, a ...
5
votes
4answers
321 views

Constant database calls or store in objects?

I'm creating a pretty simple database driven application. Whenever I create a db app, I create classes that mimic the data in the db. Is this good practice? Am I better off making one big call to the ...
4
votes
1answer
309 views

Influences on the design of Dynamic objects by Alan Kay

Alan kay in his paper, The power of Context pdf link, page 8, enumerates some of his motivations for dynamic objects. Some of the influences like Paper on lisp, early paper on the design of functional ...
3
votes
3answers
2k views

How do you annotate instantiation in UML class diagrams?

Given this pseudo code: class B { } class A : B { int val; }; alpha = new A(); What arrow do I draw between alpha and A in a UML class diagram? Is this even something UML is meant to do? ...
13
votes
5answers
826 views

Is SRP (Single Responsibility Principle) objective?

Consider two UI designers who want to design "user attractive" designs. "User attraction" is a concept that is not objective and only resides in the mind of designers. Thus designer A could for ...
3
votes
1answer
365 views

Teaching Programming: drawbacks of using unit tests in problem statement for assignments?

I am experimenting with marking assignments for a programming course using unit tests. Is it likely to harm the learning process if I publish some of the tests I use as part of the problem statement? ...
4
votes
6answers
237 views

Using all the parameters of a function

Code Complete (2nd ed.) says: "If you pass a parameter to a routine, use it. If you aren't using it, remove the parameters from the routine interface." However, in the past I sometime had to do ...
0
votes
1answer
240 views

Designing classes containing the same objects but different amount of them

I am creating a main object, MACHINE, which will contain a diversity of several other objects -- AXIS, AMPLIFIER, ENDEFFECTOR, etc. The number of contained objects will vary depending on the MACHINE ...
1
vote
1answer
294 views

Are XML databases good for small to medium non-programming business project management?

Last couple of weeks I've been searching for some project management solution for a place where I work at the moment. There we rely on excel spreadsheets, but we meet limitations like access rights ...
15
votes
5answers
836 views

How are mock objects commonly misused?

I read an article recently which said that mock objects are often misunderstood and misused. Are there any clear mocking anti-patterns which I can look out for?
11
votes
7answers
2k views

From a design perspective, what are the best practices for logging? [closed]

I want to add logging to an application I'm currently working on. I've added logging before, that's not an issue here. But from a design perspective in an object-oriented language, what are the best ...
5
votes
2answers
95 views

Simplified Interfaces or Object Abstraction

i've been facing a common situation at work that has happened quite often when handling objects. The situation goes like this: You have to realted classes A and B, class A has an instances of class ...
11
votes
9answers
4k views

When should you use a private/inner class?

To clarify, what I'm asking about is public class A{ private/*or public*/ B b; } vs. public class A{ private/*or public*/ class B{ .... } } I can definitely think of some ...
4
votes
6answers
2k views

Software design for procedural programming

Right now, I'm trying to learn a well documented software engineering. I knew that if we code using Object Oriented concept, we can do software design concept using UML. But what if we code using ...
10
votes
2answers
696 views

Design: Object method vs separate class's method which takes Object as parameter?

For example, is it better to do: Pdf pdf = new Pdf(); pdf.Print(); or: Pdf pdf = new Pdf(); PdfPrinter printer = new PdfPrinter(); printer.Print(pdf); Another example: Country m = new ...
20
votes
7answers
7k views

Why avoid Java Inheritance “Extends”

Good day! Jame Gosling said “You should avoid implementation inheritance whenever possible.” and instead, use interface inheritance. But why? How can we avoid inheriting the structure of an object ...
1
vote
7answers
433 views

Quick OOAD Question

Given the following set of classes: Camera, Photo, Photoshoot, Subject. How would they interact to model the following sentence? The next subject is called and has their photo taken. I want to ...
1
vote
1answer
886 views

best practices for solving Object Oriented design questions during technical interviews

after getting a Object Oriented design question during technical interview - for example, design a car rental program - what would be the general steps (a.k.a best practices) that the interviewee ...
6
votes
11answers
2k views

What is the point of properties?

Here are some arguments for properties and my counter-arguments: Easier to use than writing getter and setter methods Getter and setter method pairs are a code smell. Making it easier to write ...
6
votes
3answers
918 views

Duplication in parallel inheritance hierarchies

Using an OO language with static typing (like Java), what are good ways to represent the following model invariant without large amounts of duplication. I have two (actually multiple) flavours of the ...
1
vote
2answers
364 views

want to learn more about implementation of object oriented design in web application using asp.net c#

Can some one guide me about How can i have complete grasp for object oriented design. basically i am looking for a book about that or any good website you people can share . bottom line is that i want ...
8
votes
10answers
713 views

What should be first - functionality or design? [duplicate]

I've started reading a book from Head First series about OOP and Design. In a first chapter it is stated I have to worry about design of my application just after basic functionality is ready. Basic ...