Questions tagged [object-oriented]
A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner
3,433 questions
0 votes
2 answers
111 views
Should I instantiate controllers in route modules or use static methods?
I’m building a modular REST API using Node.js + Express + TypeScript. My controllers are defined as classes. In my route files, I currently create a new controller instance, like this: import { Router ...
2 votes
1 answer
256 views
Is it okay to mix OOP and modular approaches when building a backend with TypeScript/JavaScript?
I’m designing a backend in TypeScript (could also apply to JavaScript), and I’m wondering about the architectural approach. Is it better to stick to a single paradigm (e.g., fully object-oriented or ...
2 votes
3 answers
636 views
Convenience inheritance
Sometimes, you inherit from a class that defines the semantics of your type (Shape – Ellipse – Circle). Other times, you inherit simply because it's convenient to do so. A superclass may have ...
5 votes
3 answers
666 views
How to get rid of Mappers and make objects build themselves?
I am having a really hard time deciding where to instantiate my entities in the refactoring I am making. The project was built with DDD and it's layered: it has the infra, domain and app layers. In ...
0 votes
2 answers
376 views
Global State, How To Do IT?
im kind of a newbie so take me easy i face a problem every time i make a project specially Client projects, which is Global State i always struggle to do it for example, here is the structure of one ...
0 votes
2 answers
156 views
Is it better to pass a specific “context” object to handlers rather than the entire domain object?
I’m designing a system where various “handlers” apply business rules to an object. Initially I had each handler receive the full domain object: // A large domain object with many properties and ...
3 votes
2 answers
264 views
How to structuring a read/write submodule in OOP Python
I am developing a python package that needs to be able to read/write from/to multiple formats. E.g. foo format and bar format. I am trying to contain the functions relating to each format in a single ...
2 votes
2 answers
244 views
Best way to add asynchronous execution for already implemented synchronous process
I have a complex process implemented in Java Spring microservice. Currently this process is triggered on user request and it is synchronously executed. This often results in a gateway timeout. ...