factory-pattern Questions
3
Solved
I am putting together an explanation and code example of this design pattern, attempting to help others around me grasp it (along with helping myself to master the pattern as well).
What I am look...
Aerobatics asked 4/11, 2010 at 18:31
5
Solved
First of all please forgive me if its a really dumb question, I am just trying to learn this language to its core. I am reading Effective Java and the very first chapter talks about Static factory ...
Regen asked 2/11, 2010 at 15:51
20
I have been using factory method creation pattern for awhile now. I was just recently told that this:
public static class ScheduleTypeFactory
{
public static IScheduleItem GetScheduleItem(Schedul...
Traweek asked 30/4, 2009 at 13:30
5
Solved
I've been becoming more familiar with the Factory Pattern (along with Strategy Pattern) and what a great benefit the pattern can have. However, I've been struggling with the following situation:
P...
Reminiscence asked 27/10, 2010 at 16:58
4
Solved
I'm having a hard time figuring out how to implement a factory pattern in a DTO mapper I'm trying to create. I'm pretty sure I need to rethink my design. Here is a very small example of what I'm ru...
Catadromous asked 26/8, 2010 at 19:15
1
Solved
I have created a factory and a set of specifications to create and validate an aggregate root. Currently I have some tests for the factory that call the specifications on the product of the factory...
Elna asked 21/4, 2010 at 16:32
3
Solved
I'm currently implementing the Factory design pattern in Python and I have a few questions.
Is there any way to prevent the direct instantiation of the actual concrete classes? For example,...
Heptameter asked 18/8, 2010 at 10:19
4
Solved
Possible Duplicates:
Factory Pattern. When to use factory methods?
Why do static Create methods exist?
Though I know what is Factory Design Pattern. But I am unable to comprehend wha...
Incubation asked 28/7, 2010 at 4:35
2
Solved
Trying to figure out how to best handle the following scenario:
Assume a RequestContext class which has a dependency to an external service, such as:
public class RequestContext : IRequestContext...
Dordrecht asked 10/6, 2010 at 12:15
1
Solved
I noticed the function Object.factory(char[] className) in D.
But it does not work like I hoped it would work; it does not work ;)
An example:
import std.stdio;
class TestClass
{
override strin...
Compose asked 28/5, 2010 at 16:7
3
Solved
I am really confused about these three terms.
My understanding is that:
in the Factory pattern, there is no concrete factory. The factory builds the new objects according to the parameters.
in...
Unlikelihood asked 17/1, 2010 at 3:58
3
Solved
I have a problem that I’ve tried to get help for before, but I wasn’t able to solve it then, so I’m trying to simplify the problem now to see if I can get some more concrete help with this because ...
Hazelwood asked 5/5, 2010 at 11:48
5
Solved
This has bothered me for awhile, and I have no clues if this is a myth.
It seems that a factory pattern can ease the pain of adding a dependency for a class.
For example, in a book, it has ...
Lovage asked 23/4, 2010 at 9:49
3
Solved
I am trying to use a factory pattern to create a QuestionTypeFactory where the instantiated classes will be like MultipleChoice, TrueFalseQuestion etc.
The factory code looks something like this
...
Garber asked 6/4, 2010 at 2:35
6
Solved
Currently I have created a ABCFactory class that has a single method creating ABC objects. Now that I think of it, maybe instead of having a factory, I could just make a static method in my ABC Met...
Gruver asked 1/4, 2010 at 21:0
9
Solved
I was wondering, why do static Create methods exist?
For instance, why use this code:
System.Xml.XmlReader reader = System.Xml.XmlReader.Create(inputUri);
over this code:
System.Xml.XmlReader ...
Kobe asked 18/3, 2010 at 13:55
3
Solved
I seem to be mentally stuck in a Flyweight pattern dilemma.
First, let's say I have a disposable type DisposableFiddle and a factory FiddleFactory:
public interface DisposableFiddle : IDisposable...
Lycia asked 25/2, 2010 at 17:34
2
Solved
In the book Domain Driven Design, by Eric Evans, in Chapter 6 in the section on "Factories" (page 139) it says the following:
"The two basic requirements for any good FACTORY are:
...
"2. The F...
Luxembourg asked 3/2, 2010 at 19:0
5
Solved
The Singleton and the Registry patterns were very simple and easy for me to understand right away but the Factory pattern has been something I haven't been able to get my brain to interpret 100% ye...
Oliguria asked 26/1, 2010 at 9:17
2
Solved
I've got a factory method inside a parser. Essentially as I load a token I look up the handler for that token, or drop through to the default handler. I've implemented this as a switch and as a Dic...
Pudendas asked 20/1, 2010 at 4:43
1
Solved
I don't have a lot of experience with the factory pattern and I've come across a scenario where I believe it is necessary but I'm not sure the I've implemented the pattern correctly and I'm concern...
Portiere asked 12/12, 2009 at 6:13
3
Solved
I'm reading Programming Perl, and I found this code snippet:
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
color => "bay",
legs => 4,
owner =>...
Zarathustra asked 25/10, 2009 at 16:48
2
Solved
I have a model on top of my database model and map the objects in my Repository.
However, apparently it makes a difference whether I "select new" directly in my GetUsers or "select factoryresult" ...
Wearable asked 2/9, 2009 at 8:2
9
Solved
This seemed to spark a bit of conversation on another question and I
thought it worthy to spin into its own question.
The DRY principle seems to be our weapon-of-choice for fighting maintenance
pr...
Redhot asked 6/7, 2009 at 14:35
5
Solved
I was working with java code that is supposedly using the Factory pattern, but I'm not completely convinced by the pattern.
My code does this:
// the factory
class SomeFactoryImpl {
Set<SomeC...
Pietje asked 22/6, 2009 at 10:31
© 2022 - 2024 — McMap. All rights reserved.