Del Elson
Aug 29, 2021

--

Don't do this. Don't store your config in code. Store it in config. You can use a constructor to initialise the model class config from the system config but you never know when you need to change your config (or even change how you're storing your config), and you don't want to have to change your code because your config changes. What if your config is different between dev/test/production environments?

--

--

Del Elson
Del Elson

Written by Del Elson

Since moving from Australia to Vietnam in 2014, Del has been running training courses in software architecture and technical architecture for the IT industry.

No responses yet