121 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
55
views
Is there a way to skip Xunit tests only in one derived class?
I'm using a template method for tests with an abstract base class.
The abstract class is just a template with code that will be used in each derived class, and when some part of the code differs, I ...
0
votes
2
answers
86
views
Is it possible to use a modified version of a class template parameter pack in a members template?
I am trying to write a class template with a variadic template parameter pack which is separated into two groups of arguments. Those shall be used in member templates.
template <class... Args>
...
0
votes
2
answers
445
views
Template Method vs Decorator Pattern [closed]
I write the code in Java and I have a case where I need to get the status of an order depending on the product type. Each product type has the same base logic as written below.
protected String ...
0
votes
0
answers
136
views
TemplateMethod pattern for REST API
I am trying to use TemplateMethod pattern for creating ServiceBaseClass which will be called from RESTAPI
I am trying to create a wrapper API to call another API, another API will have around 50 ...
1
vote
0
answers
75
views
Child classes common method in Template Method design pattern
I have to implement a solution where the code behaves differently according to different conditions.
I created some pseudocode to show it:
public void generalMethod() {
firstMethod();
...
0
votes
1
answer
314
views
Cannot use generic in abstract class
In my Spring Boot app, I am trying to implement Template Method and in my concrete class, I am trying to use generic as shown below:
template interface: Not sure if I need to use it?
public interface ...
user avatar
user19540291
0
votes
0
answers
164
views
Duplicating current service or using Template Method (Design Pattern) in Java?
In my Java (Spring Boot) app, I have the following pdf service that uses BrandService:
Service:
public interface PDFService<T, S> {
String generatePdf(UUID uuid);
}
BrandServiceImpl:
@...
user avatar
user19254373
0
votes
0
answers
118
views
Template method pattern application
I have implemented the template method design pattern to handle the generation of different types of emails in this way:
public abstract class TemplateBuilder {
public buildEmail(Map<...
0
votes
1
answer
116
views
Using Template Method (Design Pattern) for differentiate fields
I have been using a Create Request as shown below and needed to implement an Update Request with some fields non-required.
@Data
public class CreateRequest extends BaseRequest {
@NotEmpty
...
user avatar
user18952345
1
vote
0
answers
69
views
Python : using import * at local scope
I'm tring to use factory pattern (or factory method pattern) for image analysis. But memory and harddisk restriction keeps me to reduce any of dependencies as much as possible or make them as soft-...
1
vote
0
answers
242
views
Template Method pattern testing with Java JUnit
I am writing template method pattern for Sorting (SelectionSort, InsertionSort and QuickSort). I wrote SelectionSort interface, following by its implementation (SelectionSortImpl) and then its unit ...
1
vote
1
answer
361
views
Classes with template method design
I have made this four classes and I'm wondering if I used the template method design pattern correctly because I'm really struggeling with this subject.
I have used the methods getPrijsBehandeling() ...
0
votes
0
answers
128
views
template method design pattern - how to save and feed information into next step
I have an interface RequestProcessorInterface. There are different scenarios for processing a json request e.g. async vs synchronous request. I am trying to use template method pattern where the steps ...
1
vote
1
answer
158
views
Can I create my own methods in a subclass using the template method design pattern?
Whether using methods created outside the abstract class will disturb the Template Method design pattern? Will it still be Template Method pattern if I create MyOwnMethod and call it inside a method?
...
0
votes
1
answer
168
views
Java AbstractQueuedSynchronizer and the template method pattern
While reading the source code of ReentrantLock, I found that internally it use a synchronizer which extends AbstractQueuedSynchronizer to control the lock. Doug Lea mentioned in this paper that ...