Skip to main content
12 events
when toggle format what by license comment
Nov 6, 2017 at 13:21 vote accept JNMN
Nov 5, 2017 at 15:33 comment added candied_orange Do you need more about how to write the factory?
Nov 4, 2017 at 13:31 answer added candied_orange timeline score: 0
Nov 3, 2017 at 15:10 comment added JNMN @CandiedOrange It's only going to ask once and then run until we find our solution
Nov 3, 2017 at 3:25 comment added candied_orange Do you want to ask the user for the choice every time the factory is used or would it be better if the factory just worked when asked (using a default value until told to use another one, whenever the user provides input).
Nov 2, 2017 at 19:43 comment added JNMN @CandiedOrange So essentially all I've been told is transform the selection methods etc. into a factory pattern. What i've done for seleciton for example is create an interface ISelection, made sure that all selection classes implement the specific methods. Then I created a "SelectionFactory" which creates a new Instance of ISelection and takes user input to see what type of selection they want. I.e if(userinput == "roulettewheel") { return new RouletteWheel(): } " However I'm not sure if that's right. So i think to answer your question it's user input which controls the choice
Nov 2, 2017 at 16:55 comment added candied_orange I've been thinking about this for a while and what I'm stuck on is this: how do you want to control the choice of selection? It could be you want to be able to edit a line of code and recompile, It could be you want to process an input string and chose based on the value of the string, It could be you want to process a configuration file that is read when your program loads. Give me a hint about your real needs here.
Nov 1, 2017 at 21:09 comment added JNMN @CandiedOrange Yea I only I have three. I mean I understand the general factory pattern. I've been reading head first design pattern book and looking at tutorials on yt. It's just I find most places treat your abstract class as a place to define setter/getter methods while I don't have any so I'm kind of getting confused in this sense
Nov 1, 2017 at 20:49 comment added candied_orange I just handled an abstract factory question here. The example lets you switch between 2 factories that each will make 3 different things when asked (so 6 all together). But it sounds like you only have 3 things to switch between. Right?
Nov 1, 2017 at 20:36 history edited candied_orange CC BY-SA 3.0
We hates horizontal scroll! We hates it! Nasty evil scroll.
Nov 1, 2017 at 19:52 review First posts
Nov 2, 2017 at 7:35
Nov 1, 2017 at 19:50 history asked JNMN CC BY-SA 3.0