HTTP Request: POST /user/repos { "name": "my-awesome-project", "description": "This is your first awesome repository", "private": false, ... } //HTTP Request: POST /user/repos { "name": "my-awesome-project", "description": "This is your first repository", "private": false, "visibility": "internal" | "public" | "private" ... } // internal — restricted to members of an organization // public — publicly accessible from the internet // private — restricted to repository creators and collaborators
enum TemperatureScale { FAHRENHEIT, CELSIUS } // Preferred Thermometer.newInstance(TemperatureScale.CELSIUS) // Over Thermometer.newInstance(true) //Boolean // Evolve in future without a new static factory to Thermometer public enum TemperatureScale { FAHRENHEIT, CELSIUS, KELVIN }
we want to have a fixed design and intentionally don't want to extend the functionality. For example: bool enable_tracing or bool enable_pretty_print. • Use an enum type if we want to have a flexible design but don't expect the design will change often. The rule of thumb is the enum definition will only change once a year or less often. For example: enum TlsVersion or enum HttpVersion. • Use string type if we have an open-ended design or the design can be changed frequently by an external standard. The supported values must be clearly documented. For example: • string region_code as defined by Unicode regions. • string language_code as defined by Unicode locales.
if we want to have a fixed design and intentionally don't want to extend the functionality. And if you can avoid tri-state. For example: bool enable_tracing or bool enable_pretty_print. • Use Lookup tables if we want to have a flexible design and save table space at the cost of table joins. For example: customer_type or temperature_scale_type. • Use string/char/number type if we want to have a flexible design and table join performance is high at the cost of table space. The supported values must be clearly documented and have database check constraints. For example: • customer_type char(1) as R - Real, T - Test, D - Demo • region_code char(3) as usa, can, eu