CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 23:19:11 GMT
content-type: text/html; charset=utf-8
cf-ray: 96789455c8d8c464-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=bc3cdfd1-13c7-48d2-bf41-d4c0d65b14ba; expires=Thu, 30 Jul 2026 23:19:11 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: cdeb3229-3182-444c-951b-c9148bbcfa4b
x-worker-origin-response-time: 449000000
x-dns-prefetch-control: off
set-cookie: prov=bc3cdfd1-13c7-48d2-bf41-d4c0d65b14ba; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=HhlNiofyaCnsFoNk1lf9u0Xk6lFFdq._6v1ak38eCMs-1753917551-1.0.1.1-JLqWtdl_W.xPL.kaVsLL3WN7HMtlBTLLZDEPwwlElmbzQzlZrM0CZdxbQ2p9EtH5Ag0VJII4w_4oHNJK3k.9OkyPDBRLdPzhUA09asxl75U; path=/; expires=Wed, 30-Jul-25 23:49:11 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=OrBMqWMDwGGilic53IJVCjW0kdU46JiulljQU1BbWP8-1753917551466-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'object-oriented' Questions - Software Engineering Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more.
View results.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions 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,427 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
3
answers
490
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 ...
2
votes
6
answers
488
views
Is OOP really beneficial for enterprise-scale business software compared to procedural languages like ABAP or COBOL?
I'm currently drafting a Python coding standard for internal enterprise use, primarily targeting business applications that involve heavy data access, reporting, and transactional logic.
In this ...
0
votes
2
answers
332
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 ...
4
votes
2
answers
2k
views
Should I expose an instance's state with methods?
I've read somewhere about a pattern that is as follows: if it'll change the state of the instance, the method should be named with a verb and return void; and if the method just returns something (...
0
votes
2
answers
125
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 ...
1
vote
1
answer
101
views
When does encapsulating a primitive field into its own class make sense? [duplicate]
Let's say I have the following Java code:
public record Person(String firtName, String lastName, int age) {}
Can it makes sense to have instead:
public record Person(FirstName firtName, LastName ...
3
votes
2
answers
212
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 ...
3
votes
7
answers
473
views
Do I need to create an interface for every service class to follow good design principles?
I'm working on a custom Magento 2 module in my internship, and I'm trying to follow SOLID principles in my code.
Right now, my controller actions handle everything: getting request data, processing it,...
2
votes
2
answers
173
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.
...
6
votes
7
answers
642
views
Why do "protected variables" tend to violate open closed principle?
According to Why is Clean Code suggesting avoiding protected variables?, I know there are tons of reasons to avoid protected variables.
However, there is a reason at the currently highest voted answer ...
8
votes
5
answers
4k
views
Is it still a code smell if a class knows all subtypes but not using instanceof and downcasting?
According to Instanceof code smell, I know using "instanceof" is a code smell, so suppose there is a game with some Tools:
Tool.java:
public interface Tool{
public void printInfo();
}
...
2
votes
1
answer
212
views
Extracting type info
Suppose that I want to implement the following scenario.
There is a board and each board has a set of peripherals like leds, temp sensors, gpio and so on. Each of them implements the according C++ ...
3
votes
1
answer
228
views
Passing info between different branches of a class hierarchy in C++?
So, I have a class hierarchy that looks like this:
It is an embedded project, so the entire code will be run over and over.
I have several algorithm classes, that compute some result given some inputs....
4
votes
1
answer
272
views
Refactoring a codebase from manual memory management to RAII
Edit: @Ben Cottrell's comment said this was similar to a question about spaghetti code. While both questions involve large codebases, mine addresses a specific technical pattern: manual memory ...
13
votes
13
answers
3k
views
Should setters silently sanitize input — or should they just throw? [closed]
Suppose the code's inside some FullName class
And suppose I want only capitalized name elements (let's ignore the fact that in some cultures, name elements may start with a lower-case letter)
Should I ...
- The Overflow Blog
-
-
- Upcoming Events
-
2025 Community Moderator Electionends August 13
- Featured on Meta
-
-
-
Related Tags
design-patterns × 693
design × 608
object-oriented-design × 520
java × 487
c# × 364
php × 262
c++ × 240
inheritance × 191
python × 158
architecture × 155
interfaces × 153
class-design × 140
solid × 139
domain-driven-design × 124
mvc × 89
class × 88
encapsulation × 78
refactoring × 74
composition × 65
polymorphism × 65
javascript × 61
more related tags
Hot Network Questions
- Wolf and sheep probability
- Hill Estimator for SkewStudentT is Biased
- Shakespearean grammar: "hath" and "has" in the same sentence
- Taking small amounts till there's nothing left
- Ik having chaotic movement
- Can I bring mycelium pellets into Greenland?
- Integral with multiple variables
- How Does Code Reuse Work at NASA
- Finite projective plane with trivial automorphism group
- Is it ethical to hire a graphic designer for a job talk?
- If the police observe evidence of a different crime while in "hot pursuit" can they act on it?
- Short story about a scientific rivalry that leads to madness
- Can a body part of a defeated monster act as an associated object for the Teleport spell to find a creature's lair?
- Is it commonplace/acceptable for university professors to not teach Evolutionary Biology based on their religious beliefs?
- I applied for a postdoc and the position was left unfilled because no candidate was found to be a good match. Should I follow up?
- In a TVS, is directionally bounded the same as bounded?
- CCZ magic state teleportation
- Stepping down voltage from Li-ion to simulate 2x AAA batteries
- Middleschool student shows unusual level of insight. How to take the next step?
- A customized alignment environment with indentation effect
- How loud were the top-of-the-range propeller aircrafts like the Lockheed Constellation when commercial jet travel appeared?
- QuantLib `RangeAccrualFloatersCoupon` instanciation fails
- The dative plural form "den Einen" in Schopenhauer's 19th-century German – can "ein-" be used for plurals?
- How did Gauss study mathematics?