Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you share configuration information or business rules between languages

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.

like image 593
Ken Avatar asked Oct 27 '08 13:10

Ken


People also ask

What is an example of a business rule?

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.

Why do you think it is important to capture document and manage business rules?

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.

What are business rules and how do they benefit the businesses?

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.


2 Answers

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.

like image 58
Jouni K. Seppänen Avatar answered Sep 22 '22 16:09

Jouni K. Seppänen


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.

like image 41
tloach Avatar answered Sep 21 '22 16:09

tloach