factory-pattern Questions

6

Solved

I am trying to create a Generic interface where the parameter type of one of the methods is defined by the generic EDIT I've changed the question slightly after realising I have probably confused...
Druggist asked 8/9, 2016 at 8:55

4

Solved

Right now I have a class called A. I have some code like this.. from my.package.location.A import A ... foo = A.doSomething(bar) This is great. But now I have a new version of A called A, b...
Parasitology asked 22/7, 2011 at 17:25

10

Solved

I would like to pass values into the constructor on the class that implements my service. However ServiceHost only lets me pass in the name of the type to create, not what arguments to pass to it...
Yeta asked 16/3, 2010 at 13:53

5

Solved

I am using the faker.js library to generate random data and I have a couple of factory functions that generate a series of user data: const createUser = () => { return { name: faker.name.findN...
Adulteress asked 17/3, 2017 at 15:42

4

Solved

I was wondering if there is an opposite pattern of the factory pattern. For example, when a certain object needs to be deleted some extra work needs to be done, to undo the configuration which was ...
Leuctra asked 15/9, 2009 at 7:52

15

Solved

I was wondering how I could implement the simple factory pattern with Spring 3 annotations. I saw in the documentation that you can create beans that call the factory class and run a factory method...
Yuan asked 17/6, 2011 at 19:27

15

Solved

Can any one explain the difference between factory and strategy patterns? For me both are looking same other than an extra factory class (which create an object of product in factory patterns)

3

I have a number of classes that implement smoothing techniques on a series of prices. I am trying to figure the best way of implementing any of these smoothing classes within the __call__ function ...
Contreras asked 22/3, 2022 at 11:51

17

When is it a good idea to use factory methods within an object instead of a Factory class?
Depart asked 16/9, 2008 at 6:38

11

Solved

The no-argument constructor is a requirement (tools like Hibernate use reflection on this constructor to instantiate objects). I got this hand-wavy answer but could somebody explain further?...
Fictionist asked 29/5, 2010 at 16:43

21

Solved

I know there are many posts out there about the differences between these two patterns, but there are a few things that I cannot find. From what I have been reading, I see that the factory method ...

3

Solved

I understand that a factory method is a class method that utilises the self keyword and instantiates an object of it's own class. I don't understand how this is useful or how it can extend the func...
Furrier asked 21/5, 2016 at 14:54

5

Solved

I've been pulling my hair out for awhile on this one, essentially I'm trying to implement a generic repository factory, which is called as follows: var resposFactory = new RepositoryFactory<IRe...
Haloid asked 14/9, 2011 at 10:30

2

I want to write a generic builder class which wraps around any java class and providing setter functions of a specific style. I am not sure if this could be called "dynamically generated functions"...
Sherri asked 24/7, 2014 at 14:14

2

Solved

I've read this question about the Abstract factory pattern, but the only answer to it tries to emulate in Haskell what one would in OOP languages (although the foreword is along the lines you don't...

2

Solved

I am trying to understand and exercise the plugin pattern, as explained by Martin Fowler. I can understand in which way it makes use of the separated interface pattern, and that it requires a fact...
Backbone asked 6/7, 2018 at 20:35

2

Background We are building a web application using ASP.Net Core and Entity Framework Core 2.2 We are connecting to legacy databases. The setup is that there are 16 databases, all with the exact s...
Butterworth asked 19/2, 2019 at 7:26

3

Solved

I'm creating some classes for dealing with filenames in various types of file shares (nfs, afp, s3, local disk) etc. I get as user input a string that identifies the data source (i.e. "nfs://192.16...
Werth asked 20/1, 2015 at 0:5

2

Solved

I would like to implement Factory pattern in my project..i have gone through online resources and I came to know that spring ServiceLocatorFactoryBean should be implemented instead of normal java f...
Banbury asked 30/11, 2015 at 7:2

27

Solved

What is the difference between the Builder design pattern and the Factory design pattern? Which one is more advantageous and why ? How do I represent my findings as a graph if I want to t...

2

Currently I am trying to write an automated test suite using Selenium and Proboscis. I am trying to abstract the webdriver and implementing through the factory pattern. Page_object class is also cr...
Shower asked 10/7, 2012 at 18:58

3

Solved

I'm implementing a C++ program that can programmatically instantiate objects given an input file which provides the class names and arguments to pass to the constructors. The classes are derived f...
Hulahula asked 19/12, 2011 at 0:27

2

Solved

I've been reading the book Head First: Design Patterns, which I have found to be a good introduction to design patterns. However, I've got a question about a claim they make in Chapter 4: They def...
Basilisk asked 22/10, 2014 at 15:58

3

Solved

I'm using Unity and try to follow to SOLID-principles as far as possible. Therefore all implementations only have dependencies to interfaces. I have a collectionwrapper which looks like this: pub...
Lodovico asked 11/2, 2016 at 8:29

6

Solved

I have created Exception xml and dynamically create and throw exception. <exception-mappings> <exception-mapping key="exceptionkey1"> <class-name>com.package.CheckedException&lt...
Stover asked 5/8, 2014 at 3:4

© 2022 - 2024 — McMap. All rights reserved.