Skip to main content

Questions tagged [class-design]

General guidelines on how to design classes with best known industry practices.

0 votes
2 answers
190 views

I have a Python class called FunctionsManager; its __init__() method is the following: class FunctionsManager: def __init__(self, instance_class1, instance_class2, ..., instance_classN): ...
User051209's user avatar
4 votes
3 answers
298 views

First, I'd like to highlight my personal premise on error handling approaches in C++ (as it might be the source of confusion in the first place). C++ Standards, 2004 (Sutter, Aleksandrescu), item 68 ...
Aleksandr Medvedev's user avatar
3 votes
1 answer
194 views

Imagine I got user which might be either author, administrator, reviewer An author have relation on book that he wrote. An administrator have relation on banned user (we track which administrator ...
Vincent PHILIPPE's user avatar
0 votes
1 answer
270 views

I'm devising an API - or actually, a wrapper API for another, lower-level API - in a programming language with objects. This API represents some entity E which is reference-counted (for example - a ...
einpoklum's user avatar
  • 2,808
0 votes
0 answers
108 views

I'm designing a library for CANopen protocol. The basic CANopen frames are PDO and SDO, where PDO is like UDP (fire and forget) and SDO is like HTTP (request and response). A CANopen device is a PDO ...
Jackoo's user avatar
  • 119
1 vote
3 answers
224 views

I am creating a cinema website focused on client services, where clients can reserve tickets for movies and browse the cinema's schedule (both daily and weekly). The schedules will be managed by an ...
Moncef Drew's user avatar
7 votes
6 answers
1k views

I have a class that has a callback function that gets triggered on some event. The user of the class instance is expected to do stuff on the instance itself, inside this callback function. So I am ...
doca's user avatar
  • 255
3 votes
1 answer
616 views

I want to understand what is considered best-practice to better align with OOP when handling relational databases. I cannot find any online examples where classes and a more maintainable/re-usable ...
Yannis's user avatar
  • 147
-2 votes
1 answer
533 views

Say I have a class with a function do_thing that is comprised of multiple steps, which themselves segregate into functions (first_process and second_process). At what point would this be considered ...
Tim Kirkwood's user avatar
0 votes
1 answer
169 views

I'm creating a web application with Asp.Net Core MVC, and I've replaced Entity Framework with a custom data store. I've decided to use Dapper, but have never used it prior to this project. So I'm ...
eaglei22's user avatar
  • 147
0 votes
1 answer
158 views

I'm working on a library of C++ wrappers/bindings, for another, C-ish, API. The C'ish API has a "launch" function, which, among other things, takes a launch configuration structure (well, ...
einpoklum's user avatar
  • 2,808
0 votes
2 answers
233 views

Recently I read about ISP and wanted to implement it into my project. While implementing my design I think I found a flaw which violates LSP but I'm not sure. Given I have a game project, in which ...
Boudebouz1's user avatar
4 votes
1 answer
234 views

What I mean by "closed class hierarchy" is a set of known base/derived classes used only for an implementation of something with no public API, i.e., the classes are not meant to be derived ...
Paul J. Lucas's user avatar
0 votes
1 answer
145 views

Consider Chess as an example. Say, we have a lot of domain objects that are alike, in this case chess pieces. I have two proposes to implementing the behaviour of chess pieces. Both uses the following ...
Daniel Birn's user avatar
2 votes
2 answers
1k views

Anybody have advice on splitting up a large SQLAlchemy model into smaller parts? I have a ~2000 line model called Article that is becoming difficult to manage. We often have to scroll and scroll to ...
caseym's user avatar
  • 129

15 30 50 per page
1
2 3 4 5
31