Timeline for Factory of factories? [closed]
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 28, 2015 at 17:00 | history | closed |
Scant Roger Ixrec user53019 |
Opinion-based | |
Nov 27, 2015 at 17:25 | comment | added | Mike Nakis | @Neil be my guest, I would be most happy if you steal it. It comes from this answer: programmers.stackexchange.com/a/129557/41811 | |
Nov 27, 2015 at 15:43 | answer | added | Doc Brown | timeline score: 7 | |
Nov 27, 2015 at 15:28 | review | Close votes | |||
Nov 28, 2015 at 17:00 | |||||
Nov 27, 2015 at 14:52 | comment | added | Bart van Ingen Schenau | @q126y: I don't know how games like GTA work or how important a vehicle type is there. For all I know, they just have a single factory that creates vehicles. Why would I use a separate BikeFactory and CarFactory if in the end I just want to have a vehicle and I don't care in the code if that vehicle is a car or a bike. | |
Nov 27, 2015 at 14:42 | comment | added | q126y |
@BartvanIngenSchenau Say, in GTA like game, how are different vehicles, cars, bikes, motorcycles, etc. generated? Do they hard code it? or to spawn random vehicle on next turn, say,getVehicleindustry(randomVehicleIDgenerator) , call buildVehicle() on the returned factory?
|
|
Nov 27, 2015 at 14:07 | comment | added | Neil | @MikeNakis Class for a factory of factories is BikeIndustry. Totally going to steal that. | |
Nov 27, 2015 at 13:42 | answer | added | Euphoric | timeline score: 5 | |
Nov 27, 2015 at 13:35 | comment | added | Mike Nakis | A factory of factories is called an industry. | |
Nov 27, 2015 at 13:32 | answer | added | HorusKol | timeline score: 2 | |
Nov 27, 2015 at 13:13 | comment | added | Bart van Ingen Schenau |
@q126y: The BikeFactory would have a method createBike(id) that creates the appropriate Bike based on the passed ID. What would be the use of the FoF?
|
|
Nov 27, 2015 at 13:10 | comment | added | q126y | @HorusKol for different bikes. | |
Nov 27, 2015 at 13:09 | comment | added | HorusKol | @q126y - so you have a BikeFactory - why do you need multiple BikeFactories? | |
Nov 27, 2015 at 13:04 | comment | added | q126y | @HorusKol Say, user selects some bike[having some ID] in racing game. I want to use factory of the selected bike, to make the bike. I will pass the bike ID to FoF and it will return me appropriate factory object. | |
Nov 27, 2015 at 12:59 | comment | added | HorusKol | can you provide details on what is the actual problem this FoF trying to solve? it might be more appropriate to use inject some kind of factory manager using dependency injection | |
Nov 27, 2015 at 12:58 | comment | added | Andy |
The MyFactory interface is generic? I can't imagine how you could have multiple factories implement the same interface, considering the point of a factory is to create an object of a concrete type, thus the definitions between the factories would differ.
|
|
Nov 27, 2015 at 12:50 | history | asked | q126y | CC BY-SA 3.0 |