𓁟 host1.bitchan.one

𓀐 @8tgdRF49: What are you working on, /g/?

people say the factory pattern is le bad and they hate on java for it but wtf else are you support to do? I have a async file manager library. it needs a callback to create a 'shared' state (i.e. allocate gpu memory for textures and gpu buffers, common hashmap for header files). also it needs a bunch of factory objects to make instances of parers (image parser, font parser, html parser) for each of the files you want it to parse. literally wtf else are you supposed to do? like File_Manager manager; (each inherit from IParserFactory that make instances of Parsers) manager.set_parsers(new Image_Factory, new Font_Factory, new ScriptFactory... x10); manager.shared_parser_factory(new MySharedStateFactory); unless you want to rely on static linking, but that is so weird for a library to require itself to be static and to have you implement a function as part of its initialization

⧖expiring0/2 kept6d ago

𓀐 @Y2ig7Ypq

⏱ 1w 👍 0

⬆ upvote 0

[⇥] sort oldest ⏱
filter [-]
𓀐 @Lw~4xY54: make your own libraries so you aren't locked into patterns. Implement something you think is better / more intuitive. maybe try a JVM lang that's not so OOP FactoryManager oriented+

⬆ upvote 0↩ reply 0