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

0
votes
3answers
62 views

Relative encapsulation design

Let's say I am doing a 2D application with the following design: There is the Level object that manages the world, and there are world objects which are entities inside the Level object. A world ...
0
votes
1answer
82 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 ...
1
vote
2answers
45 views

Can the DDD repository modify entity in the DB without an entity object?

Say I have an aggregate root Entity with some flags which are represented by an encapsulated object EntityFlags: class Entity { /** @var EntityFlags */ private $flags; ... } I have a ...
0
votes
2answers
43 views

Can I use a package visible constructor for creation?

I need a class where this can be done: // user program elder_tales.Player p = elder_tales.generate_player(); elder_tales.level_up_player( p ); but not: // user program elder_tales.Player p = new ...
1
vote
3answers
137 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 ...
0
votes
1answer
558 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
0answers
84 views

API Client Design

I'm designing a client to the Tomtom WEBFLEET.connect API in PHP. (You can read more about the API through the full documentation here: ...
-1
votes
0answers
57 views

Java: Singleton Event Driven Design [closed]

I have a singleton class ( I make this as immutable ). This class is present in the base module. It has a static method getInstance() which will initialize a new object based on the data stored in a ...
-1
votes
2answers
121 views

Design suggestion required to create an Export plugin

I am trying to create Export Module for our application, this seems to me a bit complex so I am posting it here to get some guide lines. In our database we have a list of Products, which can be ...
0
votes
1answer
28 views

How to measure the quality of my use cases?

When I'm coding something I know that there are many ways to see if my code is good or not. First is testing: I can do unit tests or even test the software by myself and see that it works or not. ...
2
votes
2answers
69 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 ...
1
vote
1answer
87 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. ...
5
votes
2answers
448 views

What is the difference between self-types and trait inheritance in Scala?

When Googled, many responses for this topic come up. However, I don't feel like any of them do a good job of illustrating the difference between these two features. So I'd like to try one more time, ...
2
votes
3answers
243 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
157 views

Best Practices - separation of concerns and inheritance issues

Here's the situation: I have a "common" Data Access assembly that contains classes used in all my projects. Some of those are abstract classes that are only implemented by my data access layers for ...
0
votes
2answers
58 views

OO Design when using communication

I have 2 applications one is written in C++ and one is written in Java. the applications communicate by passing byte arrays which represent a serialized object. each communication object represent a ...
48
votes
6answers
4k views

What really is the “business logic”?

I'm working with web development since 2009, when I started with PHP. When I moved to ASP.NET I've heard a lot about DDD and OOAD where a lot of focus is given to this "business logic" and "business ...
0
votes
1answer
41 views

System Communication: Avoiding Including a Large “HAS-A” Hierarchy Which Isn't Used

The situation: System A Huge, complicated system. Uses an important Message object with many other Message objects attached, many of which have further Message objects attached. In total, this is ...
2
votes
2answers
239 views

What should a repository really do?

I've heard a lot of the repository pattern, but I quite didn't understand what a repository should really do. When I say "what a repository should really do" I'm mainly concerned about which methods ...
1
vote
1answer
148 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# -> ...
0
votes
0answers
104 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
3answers
198 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 ...
1
vote
2answers
329 views

C# Design Issue

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 ...
2
votes
1answer
76 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 ...
3
votes
1answer
79 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
67 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
47 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
285 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
348 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 : ...
2
votes
5answers
470 views

Why sequential cohesion for operations in a method is not a good idea?

I read from the seminal Code Complete book that method statements that require to be executed in order passing parameter from one to the next is a code smell and is an example of a sequential ...
2
votes
3answers
192 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, ...
0
votes
0answers
47 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 ...
0
votes
1answer
165 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 ...
4
votes
4answers
195 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
182 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
175 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 ...
1
vote
0answers
150 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
255 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
139 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 ...
3
votes
2answers
152 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
115 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 ...
1
vote
3answers
293 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 ...
0
votes
4answers
517 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
3answers
198 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
1answer
103 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, ...
3
votes
2answers
233 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 ...
8
votes
4answers
594 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
1answer
108 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 ...
7
votes
7answers
4k views

OO Design related questions in technical interviews

I've been attending quite a few interviews recently and have been asked by companies to answer "design a [insert model]" questions more than a few times. Is this normal in the industry nowadays? ...
2
votes
2answers
95 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 ...