I'm looking for best practices for using the same data in different places without repeating yourself - this could include configuration or business rules.
Example 1. Data validation rules where you want to validate on the client using javascript, but you want to make sure by validating on the server.
Example 2. Database access where your web server and your cronjobs use the same password, username.
Ease of processing and a human-readable solution would be a plus.
In general, business rules define specific instructions or constraints on how certain day-to-day actions should be performed. For example, business rules can include: A decision-making approval structure for invoice processing where only certain managers can sign off on invoices totaling a specific amount.
Business rules are intended to assert business structure or to control or influence the behavior of the business.” Business rules help a company fulfill its mission and goals. When collecting and documenting business rules, it's important that you focus at the enterprise level, not just the project level.
Business rules are statements that regulate business decision-making in order to help a company achieve its goals. They set expectations, provide job performance standards, monitor compliance, and support organizations in automating operations.
Encode your data in JSON. There's a JSON library for pretty much any language you'd care to think of, or if not, it's pretty easy to code one up. If JSON is not enough, perhaps look at YAML.
XML is pretty globally used. Easy to read, easy to write, and human readable. If you're concerned about the space overhead (which you actually aren't if you want human readable) then just compress it before you send it out, XML compresses quite well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With