factory-pattern
C# factory - is upcast a must?
Does the C# factory pattern require an upcast? I want God in class library G to create a开发者_如何学运维n Adam in class library A without making G dependant on A. God produces Adams for consumption[详细]
2023-02-07 21:21 分类:问答proper factory pattern in C++
in C# you have to declare everything in a class so an example factory pattern could look like: namespace MySpace {[详细]
2023-02-07 12:51 分类:问答Why does factory pattern work the way it does?
I\'ve never really looked at the Factory pattern and today decided to take the time and create a quick sample based on this article (http://msdn.microsoft.com/en-us/library/ee817667.aspx), to finally[详细]
2023-02-07 01:27 分类:问答What is the recommended way to add child entities to aggregate roots?
Which is a better approach, create child entities first, then pass to the aggregate root to add them, or have the aggregate root create them? For example:[详细]
2023-02-07 00:05 分类:问答Hiding classes in a jar file
Is it really impossible to hide some classes in a jar file? I wanted not to allow direct instantiation of the classes to keep it more flexible. Only the factory (or a facade) should be visible of thi[详细]
2023-02-06 04:33 分类:问答Get all objects of a particular class in Object Oriented programming
I\'ve seen a few alternatives of how to get all objects recently and I particularly like the Factory method, but ive seen people using functions outside of their classes, calling a getAll method on th[详细]
2023-02-05 14:39 分类:问答Enforce mapping of concrete classes of a common interface in a static map
Lets say I have an enum class - ConfigElement which has some members like GENERAL_CONFIG(\"General Configuration\"), TRANSIT_TIMES(\"Transit times\").[详细]
2023-02-03 13:08 分类:问答Advice on Factory Method
Using php 5.2, I\'m trying to use a factory to return a service to the controller.My request uri would be of the format www.mydomain.com/service/method/param1/param2/etc.My controller would then call[详细]
2023-02-03 06:20 分类:问答AS3 - Parametrized Factory method using actual class name
Rather than use a hard-coded switch statement where you pass it the string name of a class and it then instantiates the appropriate class, I\'d like to pass the actual name of the class to my factory[详细]
2023-02-02 08:43 分类:问答How to implement a generic RepositoryFactory?
I\'m trying to implement a Generic Repository. This is what I\'ve got so far ... public interface IRepositoryFactory[详细]
2023-01-31 20:41 分类:问答