For example, consider the statement Select emp_name from Employees wherenet_pay $>$ '50000'.This query selects all the employees whose netsalary is greater then $50,000.DSLThe acronym DSL stands for Domain Specific language.DSL's arespecialised languages which are designed for a specific applications.For example lex,yacc,latex are domain specific languages used forgenerating lexers, parsers and formatted documents respectively. Theadvantages of a DSL are:* DSL's heavily aid in improving programmer productivity.* DSL's are closer to the domain and usually are declarative innature, hence using them results in bug-free code.On the other hand DSL's also come with their unique set of problems.* Code generated from DSL's is very difficult to understand andmostly impossible to debug.* DSL's usually are used for applications which have a standard wayof doing things as in lex and yacc. But since real worldapplications tend to change a lot over time a designing a DSL forthem is very difficult.* DSL's usually are difficult to extend to adapt for changingrequirements which discourages their adopters .* Unless very carefully designed,DSL's cannot be tuned for optimalperformance as it requires exposing their internals which defeatstheir purpose.In a real world situation, the cost of building a DSL usually outweightheir advantages even for large applications. Hence conventionalprogramming is preferred over DSL's.In this article, we will see how aDSL can be made out of SQL using a technique called "Table orientedprogramming"(TOP).But before we start please keep these points in mind:* The term DSL is used here loosely. We are talking about DSL forprogrammers working in a domain. This is not a DSL which wouldpass the elbow test.* For brevity and clarity, i will only use the basic features ofPostgreSQL in this article.* A Payroll processing system with a limited feature set is chosenas an example to suit the article and audience.TOPTable Oriented Programming is a technique of designing systems in whichall the rules(also called business rules) are present in a table(here adatabase table).These rules are also referred as soft coding. In shortTOP is about saving rules and processes in databases in addition to thedata.For example, take the scenario of a bank where the processing of thetransaction depends on the type of the account.Consider the case, wherein we have a we have a single function which performs the processing fora certain type of account. Conventionally, the mapping of the account
Leave a Comment
this kind of article is great and gives me more idea on this. on this blog gives more knowledge. thanks so much on this.