I am rather new to OOP and I can't wrap my head around a problem I have frequently encountered by now. I hope, I understand the reasoning behind why composition
I really know that when we have a state-dependent behaviour, we automatically think of state design pattern, especially when it comes to a behaviour that change
I'm facing a really hard problem. I want to create a wrapper class that can do something like "override" the state of the child without affecting the child's st
I have the following code with two repositories that have the same functionality but different return types. I want to call the findAll method
Source: https://refactoring.guru/design-patterns/factory-method I was wondering what the exact definition of a "free object" was in below context, and what free
What is the best practice for solving the number of cases of N searches? There are 3 search conditions for me. There are search conditions of A, B, and C. In th
I'm developping a Twitch Bot for approximatively a year now. Over the time, the bot became bigger and bigger to add features. Now the bot can manage multiple in
I would like to know best coding practice or design pattern which I can follow to achieve following task in Java: I need to enable check box in UI based on cert
I am writing a framework that allows us to intercept certain function invocations so that we can manage them(enforce timeouts and retries, persist return
I have an animal interface and subclasses like birds, cats..etc that extends from the Animal class and I have a factory class.. my question is can I use facade
I have a service method that does so many things. public Result DoSomething(){ var queryResult = service.GetResult(); SaveResultToRedis(queryResult
In order to ensure that my program will be compatible with any screen size, I first have a very small 'setup' window open when the program is launched, which wi
I have, say, two devices. class Device1{ public: int GetData(){ //... } }; class Device2{ public: bool GetData(){ //... } }; I have a a C# sty
So, I've been studying design patterns and in the context of the Single Responsibility Principle I tried to calculate the Lack of Cohesion of methods (LCOM) in
Can someone please tell me which design pattern is used in the code below? This code has been used in a recruitement test (live codingame test
I have quite large website for incident analysis. Now the owner wants to make a smaller analys tool with parts of the old tool to make it simpler for smaller in
I have quite large website for incident analysis. Now the owner wants to make a smaller analys tool with parts of the old tool to make it simpler for smaller in
Suppose that I have two different solvers that both will be called at run time. I want to call solvers' api and get resulted Eigen matrix through the base class
I'm looking for some good ideas on software design for this problem: A server sends an array of Steps: type StepTypeEnum = 'SECURITY' | 'PERSONAL_DETAILS' | ...
My Factory has dependency on Repository. It calls many methods from Repository. Lets say something like this: class CarFactory { private Repository reposito