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
0answers
30 views

Separation of concerns and data divided into multiple API endpoints

Is it possible to separate concerns if data is divided into multiple API endpoints ? I want to integrate with a following type of REST services: GET /product/get { "id":1, "fields":[ { ...
1
vote
0answers
43 views

Handle Named constructors with factory pattern

In my current project I'm refactoring the code to get a DBAL. I have a class Entity that is the base class for all classes that model a database table. So there are several classes that inherit from ...
0
votes
2answers
63 views

Java Interfaces in Layers pattern

I'm developing a Java software according to the object-oriented Layers architectural pattern. Every layer should be clearly separated from the rest, and provide a well-defined interface to use it's ...
1
vote
2answers
121 views

Design patterns for smart containers

Suppose that there are multiple classes (let's call them Container-s) that have somewhat similar structure. They are smart containers for some other Foo-s classes. These Container-s have: [1] A ...
3
votes
3answers
121 views

“Factory Method is a specialization of Template Method”. How?

Similarities and differences between the two: Template Method Relies on inheritance. Defines the steps of an algorithm, and leaves the task of implementing them to subclasses. Factory Method ...
4
votes
2answers
153 views

How to create a safe namespace for my application in JavaScript

I'm working on an application in the browser and I would like to make sure that my code does not conflict with code from other libraries or with possible calls added by browser manufacturers in the ...
0
votes
0answers
34 views

Impl Pattern Question with respect to older post

With respect to this post What's is the point of PImpl pattern while we can use interface for the same purpose in C++? Any recommendations on how to best provide multiple implementations of ...
1
vote
1answer
106 views

Can the has-a relation in OOP become ambiguous or difficult to know?

Assume I have the following code. class D { static Integer i1 = 42; } Is it true that D has an Integer? Or is it only for instance variable that we can have a has-a relation? I also wonder about ...
1
vote
1answer
64 views

Designing interactions in Object Oriented Design

I am creating an object oriented design for a cab-calling app like Uber. I have some of the classes listed. I am having trouble in designing behavior between the classes. For example, I have these two ...
4
votes
3answers
150 views

Strategy for avoiding defensive copies while keeping correct encapsulation

I want to keep a dependency decoupled, but at the same time, once it's passed to the constructor, I want to allow changes only through Whatever (in the following example) because changing the ...
0
votes
2answers
76 views

How to handle “reverse dependencies” between classes with proper object-oriented design?

I'm trying to learn proper object-oriented design, with class relations and avoiding anemic domain models[1]. I'm creating an application to store and retrieve information about "cyberattacks". There ...
3
votes
1answer
104 views

Impacts of using class_alias() to maintain backwards compatibility in PHP

Scenario: An open-source PHP project that has existed for several years has too many classes in the main namespace that we want to refactor some of them into another namespace, but we have a widely ...
3
votes
3answers
232 views

Who are the domain experts?

In Domain-Driven Design much is said about the domain experts. They are the ones who knows about the domain, and which should be in contact with the developer in order to build the ubiquitous language ...
0
votes
0answers
33 views

Relationship Between Driving Simulation Objects

I am working on a very basic driving simulation. I am trying to decide the relationship between the following objects: Freeway, Vehicle, Driver, ProximitySensors. My real-world analysis suggests the ...
4
votes
3answers
89 views

Using Bridge and Strategy together, is my idea correct/useful?

I'm working on a website project for a software engineering course. This site will be using a database to store data, currently through JDBC and MySQL. Now the first thing I would want to do, is use ...
2
votes
3answers
104 views

How to remove dependencies on internal classes in the interface

I have a software component that is a part of a bigger software product. The software component lives in its namespace Component. Also the component has an interface (some part of it is below) that ...
0
votes
0answers
35 views

Best Practices for design similar scheduled objects?

I am trying to design the following problem. Let me show the following diagram that describes a little bit the entities I know that each week, some classes will be Monday, Tuesday, Friday on the ...
4
votes
3answers
122 views

How acceptable is to keep business logic outside entities (in separate service classes)?

We were taught that objects are self contained things with data and behaviour and therefore they should have methods that act on their attributes. But there are several situations when this coupling ...
0
votes
0answers
24 views

Spring Annotation based caching design strategy

I am using Spring and want to use spring cache to cache method responses. As I am planning to use annotation based caching and need to provide the cache names. Suppose I have following methods: ...
0
votes
0answers
42 views

Class Design for network graph

I have an C# class library that builds a network graph by reading some stored procedures, building basic entities (nodes, edges etc) and then runs many algorithms and does lots of computations on them ...
6
votes
2answers
138 views

Is it bad design to leave a Constants class when refactoring?

I've been tasked with researching and making suggestions about refactoring/cleaning up some existing code in our code base. Presently, many of our projects depend on a Constants class, which contains ...
2
votes
2answers
159 views

How to change this implementation to cover drawbacks of Mediator Design Pattern here

I am new to design patterns, here is a classic example of basic mediator pattern that has 3 problems with it, first of all take a look at the application image, diagram, code and description: We use ...
4
votes
1answer
103 views

Does an IoC Container affect the design of an application using Dependency Injection?

Is it safe to say that a Container is the "program" or mechanism that manages IoC via DI, but it doesn't really change your initial design of DI to accomplish loose coupling? In other words, if I ...
8
votes
3answers
142 views

How to model locations, academic terms and different cohorts in OO

I am working on an app for universities. The case is this: Each university has several academic programmes. Each programme has many subjects (modules). Each subject can be offered in different ...
-2
votes
0answers
53 views

How to decide what architecture use in Android isometric RPG?

I asked this question about what architecture should I use. As in every question about this, everyone says "the one that best suits you". But no one never explains how I know if a architecture suits ...
4
votes
2answers
141 views

How to OOA/OOD a rather complex concept?

I'm a novice at Object-Oriented Designing and have read some OOD books & tutorials recently. Now I'm planning to implement a video player(based on existing media api, AVFoundation or MediaPlayer ...
-1
votes
1answer
62 views

When to use structured record/object, when to use list of strings?

I've written some apps using simple imperative way - now I want to learn more about building software the object oriented way. My goal is to take an Excel file and load one of the tables into memory. ...
1
vote
1answer
122 views

Pass result in API Chaining

We have set(6-8) of API and it will be invoked in a sequence . there are cases, want to use output of first/second API in the third/fourth API . We have request object which is passed as input to all ...
1
vote
1answer
80 views

What are Repositories, Services, and Actions/Controllers?

I started a project using Slim3 and PHP using limited knowledge of application architecture. The plan was to create the project and separate application concerns. It was all going well, but things got ...
2
votes
2answers
145 views

OO design of Ad application

I am making an oo design for an app. So far, I came with this, I looks like it could work, but I am not sure of correctness of it's design. Old design EDIT Okay so, I used factory pattern, and it ...
3
votes
2answers
103 views

Mechanical State Estimator design

I want to write a library for Mechanical State Estimation of a vehicle. This is, estimate variables as position, velocity an so on, using the information provided by different sensor measurements (GPS,...
6
votes
3answers
708 views

Is there a canonical or favourable classification of software design problems?

The question seems to be quite vague, so let me give some background: I have given the concept of design patterns some thought and stumbled upon the classification used by the Gang of Four: ...
9
votes
2answers
543 views

What Makes the Iterator a Design Pattern?

I have been wondering what it is that makes the Iterator special when compared to other similar constructs, and that made the Gang of Four list it as a design pattern. The Iterator is based on ...
1
vote
1answer
71 views

Is Design by Contract the same as using Interfaces to create a “contract”?

Does an OOP design that uses a Design by Contract mean the designer is using interfaces to create a "contract." The term "contract" is used quite often when discussing OOP interfaces, so I didn't ...
2
votes
3answers
304 views

When not to use an abstract super class?

Is there a use case/necessity (from design or implementation perspective) not to make a super class abstract? Are there any differences in the programming language in use? To make an example: ...
-1
votes
1answer
131 views

How to name a class whose purpose is to hold related objects?

I am working in a wizard in WPF application. As the wizard gathers a lot of information I have designed separate view models for each step (view) in a wizard. But I have to hold all this information ...
5
votes
1answer
115 views

Functional core for elevator system design

How can Gary Bernhardt's "Functional Core / Imperative Shell" architecture be used to design software for an elevator system? Specifically, let's say there are a few elevators, each with call buttons ...
3
votes
1answer
91 views

Implementing A Set of Rules

I have been tasked at work with implementing what I can only refer to as a rule interpreter. Part of my job is to identify production errors as they occur with shipment codes, and we are looking to ...
2
votes
0answers
226 views

Design elevator system algorithm and classes? [closed]

Here are the main classes I can think off the top of my head. All business objects will follow the abstraction (implement interfaces). I have not mentioned interface names to avoid verbosity. I have ...
2
votes
0answers
97 views

Design Pattern for Internal Builder

There is an object which is very complicated to build and many algorithms needed to figure out how it should be created (for your curiosity it is an object that represents and draws the beaming of ...
5
votes
4answers
153 views

Immutable vs mutable mobile object

I need to model a very simple mobile object (Robot) on a rectangular grid. Its state is described by position (basically a pair of integers) and direction (e.g., N, E, S, W). It only has two methods (...
120
votes
13answers
15k views

Did the Gang of Four thoroughly explore “Pattern Space”?

Ever since I first learned about the Gang of Four (GoF) design patterns, at least 10 years ago, I am having the impression that these 23 patterns should be only a small sample of something much larger ...
10
votes
4answers
227 views

When following SOLID, are reading and writing files two separate responsibilities?

I'm just starting to explore SOLID and I'm unsure if reading from files and writing to files are the same responsibility. The target is the same file type; I want to read and write .pdf's in my ...
6
votes
4answers
511 views

Does it violate any OOP principle if a member function does not use any of class properties/member variables?

I have an existing class which interacts which can open, read or write to a file. I need to retrieve a file modification for that purpose I have to add a new method Suppose this following is my ...
3
votes
4answers
130 views

Hierarchical structure that needs to enforce availability

The project I am working on has deep parent/child relationships that needs to enforce availability. Imagine we are a large Worldwide Electronic Seller (Best Buy) and selling mobile phones We have ...
0
votes
2answers
127 views

What architecture/guidelines should be considered to write reusable module of project?

Introduction I am working on MyProject which is windows (desktop) application being developed in C#.NET and DotNet Framework 4 in WPF. Project is layered as DataAccessLayer (DAL) --> ...
6
votes
2answers
267 views

Separating business logic on code

I have a Category and Product tables in database and classes on project. Category class has {id, Name} properties Product class has {id, Name, CategoryId} and other relations. And I have repository ...
1
vote
0answers
112 views

Should all classes and interfaces ultimately derive from one Class, and how does this affect type safety?

If I have "Object" as the top level class, then I have various interfaces, ISomething, ISomethingB, ISomethingC, then I have Class x,y,z, all ultimately deriving from the class Object (these ...
3
votes
1answer
84 views

How would one avoid circular object references when each element in a collection can possibly interact with any other element?

I have a class called Canvas that acts as the container for a number of Rectangle. The Rectangles have the following behavior: They can be moved within the Canvas. They can be resized. They may not ...
4
votes
5answers
273 views

Should a Match keep a list of Players or should a Player keep a reference to its Match?

In the game I am working on there is a Match object and a Player object. The game is divided into different Matches (basically a lobby). Every Player needs to be in a Match but cannot be in several ...