Let's say you use several different programming languages and frameworks in your infrastructure to handle large amounts of traffic etc.
Example Stack:
When using different languages and frameworks I usually end up duplicating most of the model validations because every "customer entry point" needs to validate its input. This is of course a pain to keep in sync.
How would you handle this without something like CORBA?
JavaScript is used to validate the form.
A language-independent specification (LIS) is a programming language specification providing a common interface usable for defining semantics applicable toward arbitrary language bindings.
IDLs describe an interface in a language-independent way, enabling communication between software components that do not share one language, for example, between those written in C++ and those written in Java. IDLs are commonly used in remote procedure call software.
Your best bet would be a framework that allows you to specify model validation in a language agnostic format, like JSON. You might end up with a validation schema of sorts, say:
{
"name": [
{
"validate": "length",
"minLength": 6,
"maxLength": 10
},
...
],
...
}
You would then have language-specific validators that could parse this format. The validators only need to be written once, and then you maintain a single schema for each model.
However, this is probably sounding a lot like CORBA/SOAP/Thrift/ProtocolBuffers/etc. at this point. That's because they were written to solve these types of problems, and you'll end up reinventing a few wheels if you write it yourself.
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