CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 23:19:17 GMT
content-type: text/html; charset=utf-8
cf-ray: 9678947d3d854e3d-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=514907c7-b267-4db9-8c03-26b67e9c0529; expires=Thu, 30 Jul 2026 23:19:17 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: f613d5d1-e0b2-4cbd-8306-c75aef04b2d8
x-worker-origin-response-time: 471000000
x-dns-prefetch-control: off
set-cookie: prov=514907c7-b267-4db9-8c03-26b67e9c0529; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=VOecTA38N4_m3fZrcuxVkccFR1qYvQ5GG9sns_W..bQ-1753917557-1.0.1.1-T3s7NYmBw1LTEq3D7CPJDd9flhisRKvcXG8zkoCGkw54TEv2kxiGHbtsxZkvB.nnhB92yYGdGlkZTxQ8ktYeoN770G5qzStB704sIwDZuz4; path=/; expires=Wed, 30-Jul-25 23:49:17 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=PLFw8pWTwJUXw2Y.s8h6zu0ktMZU5avWQYBws6x6oCs-1753917557794-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'object-oriented-design' 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-design]
Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.
1,738 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
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 ...
1
vote
3
answers
235
views
How does Object-Oriented Design fit into N-Layered Architecture?
Normally an N-Layered application is structured as follows.
User Interface layer
Business Logic Layer
Data Access Layer
DAL contains objects (data containers) representing business entities. The BLL ...
10
votes
11
answers
4k
views
Difficulty understanding benefit of Separation of Concerns
One of the motivations for separation of concerns is so a change in one place does not affect the other. I am going to make an argument with my limited understanding. Here is a scenario where I fail ...
5
votes
5
answers
931
views
Handling class specific behavior: polymorphism vs instanceof
I'm designing a system with different types of components, and I'm trying to decide whether to use polymorphism or instanceof checks for handling type-specific behavior.
I see two possible approaches:
...
user466728
0
votes
1
answer
134
views
LabVIEW Object-Oriented Scripting Engine
This question is for LabVIEW 2019. Highlighting that fact first because some of the "standard" object-oriented techniques like interfaces, type inference, template specialization, etc. aren'...
3
votes
0
answers
240
views
How to encapsulate functions inside a library
I'm working on a project that uses an in-house library, which is also used by other projects.
There are some classes and methods in other classes that are not used outside the library itself, is there ...
3
votes
4
answers
2k
views
Avoiding instanceofs with GUI composites
I have a stack of custom Row widgets. Each of them is a label with some editComponent (often a JTextComponent). Rows are aware of their previous and next siblings (if a Row has no such sibling, the ...
2
votes
5
answers
258
views
Refactoring object of large set of properties
I have a class that looks like:
class Vehicle:
coordinates: GeoCoordinates
speed: float
rpm: float
egt: float
// 100+ other parameters
A repertoire of concrete classes that use ...
1
vote
3
answers
278
views
How to allow users to provide their own child classes in a factory design pattern in c++?
I am building a c++ project that will allow users to essentially model and create their own fleet of cars.
Right now, the approach I have in mind is a Car Factory Class that will implement all of the ...
2
votes
3
answers
956
views
Is breaking encapsulation a necessary compromise for serialization?
I've been considering the way to solve this problem for a while, and I'm currently stuck between two options I both feel are suboptimal. Here's an abstract example of what I'm dealing with:
I have a ...
0
votes
2
answers
174
views
Designing a Two-Party Protocol
I want to design a two-party protocol that runs on two different processes;
each process is one party of the protocol.
My implementation of a Protocol looks as follows:
enum class Role { P1, P2 };
...
2
votes
3
answers
406
views
Implementing factory that return the correct type
Imagine I have a factory that must create object based on unknown input (let's say user input).
class Base;
class MyFactory {
static unique_ptr<Base> CreateBase(Input& input);
}
Now this ...
0
votes
1
answer
123
views
Which approach do I choose for representing objects and scenes in my 3D drawing library?
I'm creating my own drawing library in C++ to provide shared rendering code for my projects.
Since the library is designed to be used as a component of other projects, the renderer's representation of ...
2
votes
6
answers
966
views
Is it ok to assert on the behavior of return values of a testable class?
So I have a dialog for generating a random password. The user can set min, max, character categories (upper, lower, etc.). What the user basically does is configuring a StringGenerator that does the ...
0
votes
5
answers
757
views
Is it bad to pass builders as constructor arguments?
Note. It's a "spin-off" from my previous question. Not a duplicate — it focuses on a different topic
I got to know builders from Bloch's Effective Java. However, I made two changes to his ...
- The Overflow Blog
-
-
- Upcoming Events
-
2025 Community Moderator Electionends August 13
- Featured on Meta
-
-
-
Related Tags
design-patterns × 605
object-oriented × 520
design × 442
java × 250
c# × 183
c++ × 102
domain-driven-design × 102
architecture × 99
inheritance × 91
class-design × 90
interfaces × 72
python × 60
solid × 56
php × 48
dependency-injection × 39
refactoring × 31
uml × 31
domain-model × 30
api-design × 29
encapsulation × 28
mvc × 27
polymorphism × 26
database-design × 25
more related tags
Hot Network Questions
- What constitutes a 'structure' made of Force for the purposes of a Forcebreaker Weapon?
- Blakes 7 episode Powerplay. What were the 'hospital staff,' planning to do?
- What is known about the third time derivative of the expansion of the Universe?
- Has the similarity between diagrams of the expanding universe and of vapour pressure in mixtures been noted by others? Is this just coincidence?
- How to create a Face Group from selected faces, similar to a Vertex Group
- What is the difference between Render Distance and Simulation Distance?
- Problem with tikzcd in beamer
- Finite projective plane with trivial automorphism group
- Why is my 74HC595 working without VCC?
- GraphQL Search Not Working for Multilist Field (Category) in Sitecore JSS
- Golden-section optimization with complication
- General Two-dimensional Elliptical Gaussian Image Generator in C++
- A customized alignment environment with indentation effect
- Should I simply accept the terms without reviewing them for legal appropriateness?
- Nested doghnut chart
- Right size rim tape when converting MTB to tubeless
- In a TVS, is directionally bounded the same as bounded?
- How was the Universal Pictures 1936 opening logo created?
- Pokémon movie where Team Rocket is floating in calming water
- Does the colour force between two quarks get stronger because gluons emit more gluons or because quarks emit more gluons?
- How Does Code Reuse Work at NASA
- Is there a reason "replace conditional with table" isn't a standard refactoring?
- Stepping down voltage from Li-ion to simulate 2x AAA batteries
- Is Samson referred to/mentioned in the siddur/liturgy?