Tag Info

Hot answers tagged

5

SQL is based on Relational Algebra and Tuple Relational Calculus, not higher-order functions or functional programming. While SELECT, FROM and WHERE have analogous functions in other languages, SQL itself doesn't support generalized higher order functions, but only those "higher-order" functions that the language itself defines. Since SQL doesn't allow ...


3

This is related to constraint-programming. Prolog is an example of such a system. There exists javascript implementations of prolog http://yieldprolog.sourceforge.net/ . You could then make your prolog program and use it on both the server and client. Another approach is having all the logic on the server side but expose it as an api which the client could ...


3

Have a look at LINQ, which takes the basic concepts behind SQL and generalizes it to object-oriented programming. The Where operator is a bog-standard Filter, the Select operator is a projection/Map, and so on. All of the basic SQL query operations are represented in LINQ, implemented using higher-order functions, so yes, you're correct in your intuitive ...


2

It really depends on the intended audience: Are they programmers themselves or not? If they are, then providing an API will be the easy way. You can also provide a DSL, but be wary that specifying and implementing a language might not be a trivial task and you can't actually go and change the syntax at every release. Bending the syntax of a programming ...


2

The biggest problem is the huge set of assumptions that you so easily skip. Just take your example: "$600 is paid by Client A for inspection" USD or other dollar? Paid when? To whom? What counts as an inspection? Is this a mandatory payment, or only incurred if A opts to do the inspection? Are multiple inspections allowed, If so, is this per inspection? ...


2

At the syntax level, either XML or JSON would do fine. But that's the easy bit. The challenge is defining what can go in the rules. I would adopt a standard object modelling approach: what are the entities you need to represent, and what are their attributes and relationships? When you know that, encoding it in XML is easy.


2

The most commonly accepted way is to use a Business Rules Engine of some sort. Of course, if you're willing to roll your own BRE, and just need a reading on the markup language to use, I would imagine that XML is as good as any. It is hierarchical, has namespaces, and is unlikely to become obsolete any time soon. Since it's likely that we're not talking ...


1

Does this pattern have a formal definition? This is also referred as convention over configuration. Who invented it? This is a hard question, according to Wikipedia it goes back to 1960's. Apparently it's influenced by the concept of default. Is it considered a DSL? I would say yes, because it's specific to the domain of ORM framework (related to the ...


1

Here's the thing with unit tests. You want them to be really easy to write. Anytime writing a test is made more difficult, it will result in tests not being written, and bugs will be allowed to live. So let's imagine I'm writing a test: void testCanDrive() { Person person = new PersonBuilder() .doRequired() .addFirstName("John") ...



Only top voted, non community-wiki answers of a minimum length are eligible