Questions tagged [design-patterns]
A design pattern is a general reusable solution to a commonly occurring problem in software design. Use this tag for questions when you're having problems with the implementation of design-patterns. Please don't use this tag on questions about text pattern matching. When using this tag on implementation heavy questions - tag the code language the implementation is written in.
design-patterns
32,162
questions
0
votes
0
answers
7
views
How to do auto design in SolidWorks?
We want to start auto design with Solidworks.
But don't have any suggestion now, and just option is using macro.
But it is taken too much time.
So I want to improve it.
Currently, we try to use excel ...
0
votes
0
answers
18
views
Violating Interface Segregation Principle (ISP) because of fat module
I'm working with TMDB API, This API has 2 improtant endpoints one for movies and the other for series.
right now working on movies, so i made an abstraction layer (module) to get data from that API
...
0
votes
0
answers
38
views
Impossible to fill holes in a blanket implementation? [duplicate]
It seems like a single blanket implementation for some trait prevents more implementations for the same trait with certain generic attributes even if theses attributes are explicitly excluded by trait ...
-2
votes
1
answer
60
views
Am I using Builder correctly? [closed]
I'm working on a program that uses Design Patterns, and I've chosen the Builder pattern for my work.
My teacher told me I was using it wrong but I wanted to get opinions from many different people ...
0
votes
0
answers
26
views
Blanket implementation for New Type design patter [duplicate]
I'd like to find an idiomatic way to locally extend the From trait to handle more inputs to a type defined in a library. I want to do this to allow for e: Error = "Message".into(), but a ...
-4
votes
0
answers
48
views
Are there any software design patterns that come built in Python? [closed]
I'm new to programming and was exploring design patterns. I read on some forums that Python has language features which make it pointless to use a design pattern like decorator. Some sources said that ...
0
votes
3
answers
53
views
Formatting a form input field
How can you format a form input field such that it only accepts numbers from users, takes a maximum of 16 digits, and adds a space after each four digits? I am trying to create a debit card such that ...
0
votes
1
answer
57
views
Does my design violate the Liskov Substitution Principle?
I'm working on a Spring Boot application with the following structure for sending messages
public interface MessageService {
void send(String message);
}
@Component("SendEmailService")
...
0
votes
0
answers
56
views
What is wrong with my strategy design MVC code? [closed]
I am seeking the opinion of very experienced coders on what improvements are needed for this code to pass. I am unsure why it failed and would like to expand my knowledge by getting expert feedback.
I ...
-1
votes
0
answers
16
views
Python 3 class composition design pattern for large API
I have a general question about a design pattern for a very large API that I am working with. The API has thousands of possible method calls spread across multiple CGI endpoints. There are certain ...
-1
votes
0
answers
40
views
Design Pattern to use when return type and params are different between 2 similar/extendable class [closed]
I am creating a logs crawler which takes data from a log storage and then processes it.
I have such a structure:
interface ILogService{
LogResponse getLogs(LogRequest request){}
}
class ...
0
votes
1
answer
71
views
How to instantiate Singleton objects for other classes in a different class in Java?
public class Singleton {
private volatile static A AInstance = null;
private volatile static B BInstance = null;
private Singleton() {
}
public static synchronized A ...
0
votes
0
answers
7
views
R function/package to find frequent consecutive patterns in bunch of sequences
So let's say I have a bunch of sequences consisting in series of numbers going from 1 to 25. (for example (x<- (1,16,2,2,3,6,18,16)). I just want to find in all those sequences if there is frequent ...
-1
votes
1
answer
23
views
Choosing Design Pattern between DB and Web App
I want to choose a design pattern for the next scenario:
We have one database and one web app, for certain users I want to scramble one of the columns of the database.
Currently, we think Proxy is the ...
-2
votes
0
answers
17
views
Design patterns for file system [closed]
I'm working on a web app to import a file, validate it and save to db and the user can apply search, but I'm lost with the appropriate design pattern
I have a problem in finding the design pattern so ...