Questions tagged [object-oriented-design]

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

70 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
3k views

Option<T> functional type implementation and scenarios

Have you ever being implementing Option<T> functional type? It is discussed here: https://app.pluralsight.com/library/courses/tactical-design-patterns-dot-net-control-flow/table-of-contents ...
3
votes
0answers
5k views

Assembler vs Entity Translator and Entities vs DTO

I was hoping that someone could explain the exact difference between an Assembler and Entity Translator. Martin Fowler describes the Assembler as a sort of Mapper(?) which converts DTOs into Domain ...
2
votes
2answers
119 views

Domain models vs entity models vs Hibernate lazy loading

In a new Java project I plan to use an extra layer above Hibernate entities. So there would be a CustomerEntity and CustomerDomain. The reason for that is that the CustomerDomain can contain extra ...
2
votes
0answers
161 views

Is this an example of cyclic dependency?

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview. I have wrote my ...
2
votes
0answers
76 views

Creating bindable input handler in C++ spanning two separate modules

I have a wxWidgets application. This is the first, main module. The second module is an openGL engine. It's a model-view-(controller) structure, where application is the view (and the controller), ...
2
votes
0answers
68 views

Memento and releasing resources

Let's suppose we have a class whose state has to be saved and later restored, and we resorted to the Memento pattern for that. What if the state includes resources that have to be explicitly ...
2
votes
0answers
92 views

Should I pass presenter to use case when implement clean archeiture using scala

This question came to me when I was trying implement Clean Architecture using Scala, and come across this post. In the accepted answer, @candiedorange emphasis on the separation of responsibility, ...
2
votes
0answers
97 views

Access modifiers in combination of interpreter pattern with template method pattern

Motivation: (Skip to "The Problem" if you don't need motivation for it) As a project for myself, I'm writing an expression parser for certain kinds of mathematical expressions, and I'm using the ...
2
votes
0answers
404 views

Balance between aggregate boundaries and domain consistency in DDD

Designing an Aggregate and choosing an Aggregate Root getting tricky for me all the time especially when it comes to ensuring right transactional contexts and consistency constraints so I'm wondering ...
2
votes
0answers
304 views

How to separate data layer from business layer?

My current .NET project looks like below: Solution (.sln) --BusinessProject A (.proj) --BusinessProject B (.proj) --DataLayer (.proj) --A separate project calling ExternalService 1 (folder) --A ...
2
votes
0answers
80 views

Nested containers with subclasses

I have nested containers A and B. The attributes are there to show that classes have some other members. One of my functions f takes another container of such containers (let's say vector again). ...
2
votes
0answers
99 views

Object oriented design of a plugin framework based on user defined classes?

I would like to design a plugin framework, but I have not been able to find an object oriented design that fits my objectives. My broader design goal is for me to let users define classes in a ...
2
votes
0answers
164 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 ...
2
votes
0answers
482 views

Two-way adapters

In GoF there is a two way adapter concept: A potential problem with adapters is that they aren't transparent to all clients. An adapted object no longer conforms to the Adaptee interface, so ...
2
votes
0answers
402 views

What are the benefits of an input/output component design?

For the company I work at, all of our projects, including a new one started last year, are written in C89. We write for vxWorks (a real time embedded operation system). Our software runs multi-...
2
votes
0answers
373 views

Mocking third party web service

I am working on a project to create a wrapper library which will be used to interact with a web service provided by the client's IT team. The reason for this library is that we interact with this ...
2
votes
0answers
2k views

Generic Type Parameters where one is itself Generic with a Type Parameter of the Other

I have a couple of classes with the following pattern that I am uncomfortable with. Is this the only way to do this, or are their other design patterns that would be more reliable. public class ...
2
votes
0answers
563 views

How should Object Model wrapper classes behave when underlying objects are deleted?

I'm currently building an object model library for use in a project. It wraps our internal concepts - Servers, Folders, Items - in an object hierarchy (IFolder, IItem, etc), and we have several ...
2
votes
1answer
122 views

How to model workflows

I'm building a helpdesk-type system, where there are: Customer - can submit/resubmit tickets; Manager - can review submitted tickets, assign to developers (one ticket to multiple developers), review ...
2
votes
1answer
164 views

Message Mapper Design Considerations

Long question context, skip to tl;dr for the meat of it. I am designing an integration between two web applications, and have come to the conclusion that a message pattern would be an appropriate ...
1
vote
0answers
24 views

How Best To Store Data Structures Around Flow

I'm working on building a simulator for HVAC units. The conceptual model I am working with is basically that an HVAC unit has inputs and outputs, and I need to be able to calculate the outputs for a ...
1
vote
1answer
81 views

Should there not be methods intended to be only called from inside of the package, but from the outside of the class they're defined in?

Note: This is a follow-up to this question on StackOverflow. I have to write a wrapper in Python to an external API, accessible through HTTP. The code is supposed to be publicly available on GitHub. ...
1
vote
1answer
82 views

How to design a wrapper for a large, multi-response API?

Lets say there exist some service at some organization that exposes information on a company's assets, from employees, company-issued devices (laptops and issues) to the the large xerox printers on ...
1
vote
1answer
113 views

Utils, Service class and Persistence Layer

I have a method in API handler which does API validation, performs business logic and then makes a call to db. Is it a good idea to move the business logic to utility class or service class? IMO the ...
1
vote
0answers
28 views

avoid passing dbsession object to multiple modules

I have a project which has a service-oriented architecture. for example, anything relates to payment is inside payment module. -dao -config -constatnts -middlewares -modules -payment -user -...
1
vote
0answers
61 views

How to represent a set of ephemerides?

I am writing software that deals with ephemerides—tables describing the positions and orientations of celestial bodies or spacecraft—and I am struggling with how to represent them in the ...
1
vote
0answers
78 views

Expected behavior from client when thinking about design patterns?

I'm confused about the behavior I should expect from a client when thinking about design patterns. To be more precise, I'm reading the Head First Design Patterns book, and on the difference between ...
1
vote
0answers
117 views

What Design Pattern to use to render PDF pages for a PDF Proposal?

I want to create a set of patterns to use for rendering a PDF Proposal (a set of PDF pages). I have made a good start, but not clear on how to proceed when more complexity is involved. I am using ...
1
vote
0answers
136 views

How to create an “internal” api for my library which is not exposed to the user?

Note that my question is not platform specific so that's why I don't add the [kotlin] tag (the code is in Kotlin). If there is a Kotlin-specific answer I'd like to hear about it though I am working ...
1
vote
0answers
76 views

How to follow MVC in a standard iOS App theoritically?

I want to understand one thing in plain english that how do I actually use an standard MVC design pattern in iOS App. I know about Modal View and Controller and theoretically I know what they do(...
1
vote
0answers
242 views

Dependency injection in the template class

I have a template wrapper class around the container std::priority_queue that supports multithreading. The short version of it is below. In this class I employ the function IsReady() that checks ...
1
vote
0answers
121 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 ...
1
vote
0answers
106 views

Representing all possible values or a subset of values

I have a class that needs to return a set of values e.g public abstract class AbstractRule { public abstract String getName(); //Property is an example here. public abstract Set<Property&...
1
vote
0answers
141 views

Proper program design for submitting a form

I have been stuck wondering what the best solution to the problem below: I am developing a form like GUI with quite a few places for input. Currently, I am storing each UI element in an ArrayList ...
1
vote
0answers
173 views

Designing object oriented programming

Basically, I want to make api calls using an SDK I am writing. I have the following classes: Car CarData (stores input values needed to create a car like model, make, etc) Basically to create a ...
1
vote
0answers
190 views

DAO Design with Child Objects

If I have objects that represent a hierarchy of relationships. For example: Person   Spouse     Spouse Contact     Spouse Address   ...
0
votes
1answer
143 views

Where would you handle exceptions: controller, service, repository?

I have been having this dilemma from time to time whenever I have to design or start a new project from scratch. I particularly like how Spring framework is organised in terms of classic software ...
0
votes
2answers
42 views

Force State changing of an Object only from Holder

Suppose I have a Button class with a color attribute. I also have a Canvas class which stores all Buttons. Every time a color is being changed, some side action must take place (in this example, for ...
0
votes
1answer
81 views

Appropriate pattern for injector that sets a property and client that ONLY gets a property

Suppose I have a method in client code that expects an interface... void DoWork(IDataManager data) { //use IDataManager interface in the DoWork method } And the IDataManager interface looks like ...
0
votes
0answers
18 views

Is it usually good practice to declare an association methods in two models despite only using the association on one side?

Let me elaborate. Say I have a model called Credit that is categorized by a Role model. A real life example would be a track from an album. The track will have credits detailing its' contributions: ...
0
votes
0answers
35 views

What layer should resolve pre-existing Hibernate entities?

Imagine an application that consumes an external data stream and creates objects of this type: @Entity public class Event { @OneToOne(cascade = CascadeType.ALL) private EventInfo info; @...
0
votes
2answers
50 views

PHP class inheritance in variable depths across systems

I have a project where I develop a software which consists of a CORE which is in a separate project, developed separately, and a CLIENT which's base is the CORE but adds to the functionality with ...
0
votes
0answers
29 views

Ranking / Generating score card based on scoresheet details

I am busy with a score keeping app. And would appreciate suggestions/ help. I will try to be brief and hopefully have explained the main gist of the app below The app basically maintains some scores. ...
0
votes
1answer
93 views

How to decide which of two “linked” objects should be contained in the other?

Are there any guiding principles of OO design to take into account when deciding which of two interacting and linked objects should be included as a component into the other (or referenced from it)? ...
0
votes
0answers
145 views

Decorator Pattern Java

This is an object-oriented design question that is specific to Spring Boot. I'm extending a Spring Boot application that has an interface that is being extended and used inside another service. The ...
0
votes
0answers
86 views

Job Scheduling Software

I am designing a Job scheduling software. Users of the software will define the job definition in XML like format https://github.com/etingof/apacheconfig/: e.g. <job> job_name myjob &...
0
votes
3answers
102 views

How can I do a step based design form my applicaiton?

I want to create an application that has some optional steps. But I could not decide how to do step plans. It looks like a workflow. I have a Work entity. This work includes specific business steps. ...
0
votes
2answers
148 views

How to design an API wrapper with bulky operations on domain object? (Need guidance)

I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible. Context: We have a project which supports certain file operations like edit, ...
0
votes
1answer
138 views

Pattern for sequencing steps in a job to run sequentially against external system

I am trying to understand how I can make the code for this easy to understand and debug too. The reason I'm asking is that it feels like the kind of scenario which has probably been tackled before ...
0
votes
1answer
124 views

Orchestrating Object Instantiation and Intercommunication

We have a C++ project managed by UML software, which generates code for instantiating and passing data between objects. Unfortunately, this software adds a lot of overhead to our builds and ...