Skip to main content
21 events
when toggle format what by license comment
Mar 24, 2017 at 7:05 answer added Euphoric timeline score: 1
Mar 24, 2017 at 7:04 comment added Yeldar Kurmangaliyev @Euphoric I haven't stumbled upon such situations, but bank factory can override any values which base factory has set. So, bank factory can process CompanyName in any way it wants because base.Fill has already filled it in.
Mar 24, 2017 at 7:02 comment added Euphoric How is parsing of createRequest.Name handled for inheriting class? Eg. if Company has CompanyName and BankCompany has BankName?
Mar 24, 2017 at 6:58 comment added Euphoric I said method, not class. If method is "pure" then there is no problem with tread-safety and testability.
Mar 24, 2017 at 6:56 comment added Yeldar Kurmangaliyev @Euphoric It would be better if it wasn't, I avoid static classes in my application in order to make code thread-safe and testable.
Mar 24, 2017 at 6:55 comment added Euphoric Can Fill method be static? Eg. does Fill use any other "global" parameters other than it's parameters?
Mar 24, 2017 at 6:50 history edited Yeldar Kurmangaliyev CC BY-SA 3.0
edited title
Mar 24, 2017 at 6:48 comment added Yeldar Kurmangaliyev @Euphoric There is a possibility that new classes will be removed or added. Factories are not necessary, but I couldn't find another solution to implement it, considering that putting many if and switch in a single enormous method which is responsible for building objects of all types is not a solution :)
Mar 24, 2017 at 6:47 comment added Euphoric How often are new "contragent" classes added/removed? Is it really necessary to have factory for each of them?
Mar 24, 2017 at 6:44 comment added Yeldar Kurmangaliyev @PhilipKendall I have updated my answer with real-world examples.
Mar 24, 2017 at 6:43 history edited Yeldar Kurmangaliyev CC BY-SA 3.0
added 388 characters in body
Mar 24, 2017 at 6:30 answer added Ewan timeline score: 1
Mar 24, 2017 at 6:19 comment added Euphoric I see now. The Id property on the base type is what complicates things.
Mar 24, 2017 at 6:11 comment added Yeldar Kurmangaliyev @Euphoric How will it look like? Could you please provide the code? If it was a simple "combine two methods" problem, I wouldn't ask it :)
Mar 24, 2017 at 6:11 history edited Yeldar Kurmangaliyev CC BY-SA 3.0
added 628 characters in body
Mar 24, 2017 at 6:09 comment added Euphoric Uhhh .. just join those two methods together? It is so simple your question doesn't make much sense. Where is the problem?
Mar 24, 2017 at 6:08 comment added Yeldar Kurmangaliyev @Euphoric that's exactly what question is about :) How to make it a single method?
Mar 24, 2017 at 6:08 history edited Yeldar Kurmangaliyev CC BY-SA 3.0
added 628 characters in body
Mar 24, 2017 at 5:59 comment added Euphoric Why are Create and Fill separate methods? They should be single method. That way, most of the type casts disappear.
Mar 24, 2017 at 4:32 history edited Yeldar Kurmangaliyev CC BY-SA 3.0
added 24 characters in body
Mar 24, 2017 at 4:18 history asked Yeldar Kurmangaliyev CC BY-SA 3.0