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

1
vote
1answer
158 views

Designing software functions which are both pausable and restartable

Consider the following situation: One hardware device, two applications (1 C# application, 1 Firmware). The C# application sends frames to the firmware and the firmware executes scripts. C# -> ...
3
votes
3answers
224 views

OOP what is meant by object-to-object communication

I've been reading in basic concepts of OOP,as i'm trying to make this shift from transactional scripts to more oop manner in php, and i often come across this definition : An object stores its ...
3
votes
1answer
83 views

reloading singleton classes and dependency

I have a singleton object. It's a DAO that looks somewhat like this (pseudoish code): class UsersDAO { public usersDAO init(string sDSN){ variables.sDSN = sDSN; return this; } public ...
0
votes
1answer
156 views

Interface questions for using Command Pattern and Dependency Injection together

I have many projects that have essentially the same high level requirement: test all hardware on a device. Each device can have a different communication protocol, requires different test equipment to ...
0
votes
1answer
70 views

how to manage new private variables introduced into class?

Whenever I want to add a new functionality, I introduce a new private variable into the class. Declare it just above the first method definition. leave a small comment. Set it in a certain method. And ...
0
votes
0answers
49 views

delegate classes for UI events

When designing a delegate to represent the state of a UI (java swing) what is cleaner: to manipulate the delegate directly from the custom event handlers defined in the UI code, or to register the ...
2
votes
1answer
298 views

When not to move a “C style” code to “C++ or Object Oriented” code?

Context I am (part of team A) developing a piece of functionality which depends on new APIs provided by team B. Old APIs (also provided by Team B) are there and this is how they are being used in our ...
1
vote
5answers
419 views

Lots of classes with only one single static method with same name as class - Code smell? [duplicate]

I'm trying to follow the single responsibility principle (SRP) in my applications. I have lots of CRUD classes I just name xxxxxManager. Following the SRP, I made 4 classes for each one : ...
0
votes
0answers
87 views

OO design for client-server/RPC/n-tier data transfer (specifically SignalR)

I'm using SignalR to implement a client/server system, but I guess this question could apply to other tiered/client-server/RPC systems. If you aren't familiar with SignalR, you basically create a ...
1
vote
3answers
159 views

Where to Populate Objects

As mentioned in this question, I am moving our team towards objects (as opposed to just throwing DataTables and variables around everywhere). I have picked a suitable spot for the project that ...
2
votes
3answers
427 views

Empty virtual method on base class VS abstract methods

I couldn't find a question that was not too specific to some case, so I'll try to make this very generic. We need an extractor base class to a set of documents, for example. Each document has its ...
2
votes
3answers
292 views

Design for creating a menu based on user type

Problem I am building a PHP application which has a main menu, which in turn contains various "sections" or "subheadings" with various links. There are several user types such as SuperAdmin, Admin, ...
4
votes
4answers
250 views

Design pattern for bidirectional signals/events

This problem feels rather basic, yet I've never known a great solution. I'm looking for a way for components in an application to notify each other while being as decoupled as possible (both at ...
2
votes
4answers
195 views

Basic OOP Question for a Report

I'm in development of a sample project in Android for a friend's phone that keeps track of his sales. At first, one of the requirements was to create yearly reports of this sales data. This would be ...
1
vote
1answer
194 views

Should an object update itself?

I'm working on Ruby on Rails. There is a feature in our app where doctors can "claim" cases for themselves. I can either have the doctor perform the action and update the plate, or I can have the ...
0
votes
1answer
745 views

Is this proper OO design for C++?

I recently took a software processes course and this is my first time attempting OO design on my own. I am trying to follow OO design principles and C++ conventions. I attempted and gave up on MVC for ...
0
votes
1answer
180 views

Convert to Object Oriented Programming

I am currently working on a project that is fairly small for the time being. There was a recent change to implement 3-tier architecture, such that the code is now split up appropriately to data ...
1
vote
0answers
219 views

Binary Tree/Knowledge Base design C++

Currently I have a binary tree template setup where my main is using it with strings to make a question/answer game. I'm using a knowledge base that works as an interface to the binary tree that main ...
0
votes
3answers
267 views

Software architecture which allows for growth, real life situation [closed]

I know of Interfaces, Abstract classes that serve as Base class, I've been reading up on loose coupling, ... But I can't come up with a decent solution when a property of a class changes, and the new ...
-1
votes
2answers
154 views

OOP and database applications, Is it worth it? and when do i need it? [closed]

I have been coding small to medium size applications for several years now, mostly business applications or database-driven applications, In each new project i feel tempted to start with the database ...
0
votes
0answers
181 views

Javascript design pattern with jQuery Widget factory

I am using the jQuery widget framework for creating some graphical elements on a webpage, and I have a conseptual question about the overall structure of the code. I have 3 classes A, B and C which ...
3
votes
2answers
161 views

OO design for a Windows application that communicates with an external machine via RS232

I'm after a bit of OO design advice... I'm about to start developing a Windows application that communicates with an external machine via RS232. The machine has an onboard "system controller" ...
0
votes
2answers
250 views

Where should the ACL handler be called in a MVC architecture?

Thinking about Access Control Lists bound to a web MVC architecture, I have a doubt on where the verification should be done. Within Models? Controllers? FrontController? Imagine a multiple module ...
0
votes
4answers
534 views

What is this design pattern called? [closed]

I have some code: /// <summary> /// Represents Record Locator class /// </summary> public class RecordLocator : IRecordLocator { /// <summary> /// The Record Locator string, ...
1
vote
1answer
121 views

Updating an Entity through a Service

I'm separating my software into three main layers (maybe tiers would be a better term): Presentation ('Views') Business logic ('Services' and 'Repositories') Data access ('Entities' (e.g. ...
2
votes
1answer
110 views

Is it bad practice to encapsulate a single operation in a class? [duplicate]

I recently had a back and forth over at StackOverflow about my answer to this question. The question was simple. The author wanted to transform a number into an abbreviated version that appended a K, ...
0
votes
1answer
116 views

Names for generic classes - how to avoid naming them just “object”? Use synonyms?

When programming, I often end up naming some generic class (think of an abstract base class for stuff you manage in your project) something like FooObject, FooComponent or FooItem (where Foo is an ...
3
votes
2answers
300 views

Object-Oriented design and proper Java architecture for my program

This is the very first time that I think I want to create a program which really uses OOP principles and I want to do it in the most effective and efficient way. First of all we are given this ...
2
votes
2answers
125 views

Handling “unspecified” values in software

So I'm working on a software product where we have a number of fields that the customer can leave blank, some of which are numeric. To persist these in the database we use nullable columns. Easy ...
25
votes
7answers
2k views

Are classes with only a single method a problem?

I am currently working on a software project that performs compression and indexing on video surveillance footage. The compression works by splitting background and foreground objects, then saving the ...
0
votes
2answers
150 views

How to create business layer objects out of input parameters properly? [closed]

Application description I have an application of the following structure, simplified: Http request ↓ +-----------------+ | RequestParser | +-----------------+ ↓ Business ...
1
vote
3answers
204 views

A pattern to “atomically” update a pair of objects

Is there a standard pattern in OOP to kind of "atomically" update a pair of objects, like a pair of bank accounts on a transaction? I would like to have somehow a single public method exposed that ...
2
votes
2answers
539 views

C# Design Issue [closed]

I am building a small application and I am trying to understand the best way to approach the design. I am looking for some guidance/advice how best to approach the following issue. What I have is ...
0
votes
2answers
159 views

How to remove redundant code that enables button. Or “if” statement

I got probably "micro optimization" problem. I got "History number", "Next Number", "Reset" buttons, as well "label" for text. Every time I click At "Next number" button I would like to show random ...
3
votes
2answers
122 views

Refactor an old model of a LastUser Modification on every Object?

I have a software requirement, that needs to store the user that made the last modification to another object, for every object (assume that all objects are already mapped and into a BD). So we have ...
2
votes
1answer
200 views

What kind of object relational mapping is appropriate here?

In my database I have a table that looks like this Master(ID, Name, Attr1...). Every ID will have at least 1 entry in additional tables that have additional attributes. Those tables specialize the ...
2
votes
1answer
89 views

Are there any known effects on cognitive load of many files with one file per object?

There has been a trend in the Ruby/Rails community to create lots of objects that have very small functionality (SRP anyone?) and live in their own file. These are often extracted from large, bloated ...
24
votes
10answers
6k views

Can we live without constructors?

Let's say in some reason all objects are created this way $obj = CLASS::getInstance(). Then we inject dependencies using setters and perform starting initialization using $obj->initInstance(); Are ...
4
votes
2answers
247 views

How to handle status integers from database in object oriented code?

Consider a database table of Items that have a status flag represented by an integer. A few of the status might be: 0 - Past Storage; 1 - Current Inventory; 5 - Scrap; 6 - Rework; 15 - Processing; ...
4
votes
3answers
153 views

Benefits of using config files over making many small classes?

My friend and I are building a mobile game and ran into the following design problem: We will have many different types of units all with different stats and abilities. However, all unit types ...
4
votes
1answer
168 views

How can I structure my code when I have orthogonal arrays of features?

Example: You have a game with different schools of magic (fire, ice, etc). Each school has a set of properties that pertain to independent features of the game, such as: strings to be displayed on ...
2
votes
2answers
92 views

How do I recreate this Access Control/Group/ whatever methodology in OO/MVC

I am looking at trying to rewrite an application that is mostly procedural to an MVC/OO approach in order to teach myself a deeper understanding of both. BUT, I am having some conceptual issues with ...
5
votes
2answers
845 views

Open Close Principle (OCP) vs Dependency Inversion Principle (DIP)

I was trying to understand the difference between Open Closed Principle (OCP) and Dependency Inversion Princible (DIP). Based on research I've made on the internet so far, I came to the conclusion ...
1
vote
3answers
187 views

Service method, bean as an argument and mandatory attributes

There is a service: createUser(User user) where you can create a new user, with so many attributes (name, address lines...). Now, some user attributes are mandatory. Other attributes are not ...
0
votes
1answer
142 views

Boolean properties in Class A control availability of members in Class B: Design Pattern?

Given the following code: class AnimalDescriptor { String species; boolean hasLegs; boolean hasTeeth; boolean hasHair; public AnimalDescriptor(String species, boolean hasLegs, ...
0
votes
1answer
237 views

Flexible / Dynamic object creation or Alternative to list of lists [closed]

I have a xlsx file, that has some tabs with different data. I want to be able to save each row of a tab in a list. The first thing that comes to mind is a list of lists, but I was wondering if there ...
0
votes
3answers
230 views

Add behavior without changing existing class

I have a class Container, which represents wrapper around std::list. This class contains following public methods: void add(Shape *item) void next() void setBegin() Shape* curr() and protected ...
13
votes
6answers
2k views

Should a class know about its subclasses?

Should a class know about its subclasses? Should a class do something that is specific for a given subclass for instance? My instincts tells me that is a bad design, it seems like an anti-pattern of ...
1
vote
3answers
297 views

Problems with Facades and then evolution in software

I initially started a project with Facades and Polymorphism as a way to create simple extensible design following SOLID Principles. Here is a sample code: public interface IInterface { void ...
1
vote
0answers
356 views

JavaScript Class Module: How to avoid an antipattern

I've seen a number of different methodologies when it comes to applying class-based inheritance to JS/ECMA-based projects. Over the past several months, I've been applying IIFE Namespaces to my class ...