Skip to main content
2 events
when toggle format what by license comment
Aug 26, 2018 at 10:24 comment added Christophe Yes, this seems a safer and more flexible approach than reflection ! Reflection would just create an unnecessary coupling between data and the code. A new developer could miss this external dependency and rename the class. And in order to avoid that a user enters a bad class name or that a hacker exploits this design, a sanitation of the input will be necessary (which will certainly require a list of allowed strings). By the way, I suppose that this answer proposes an alternative to @bcperth's one, isn't it ?
Aug 26, 2018 at 1:46 history answered Joseph Ottinger CC BY-SA 4.0