Software Development Laboratory

software development laboratory
software development laboratory

Declarative Programming – Strategies for Solving Software Problems

Many software and hardware producers take pride in the exponential pace of technology change, but for users and consumers of their products and services the rapid technological obsolescence often means increased costs, frustrations, and unfulfilled promises. Corporate America expects to make capital investments in goods and facilities that should last five, ten, even twenty years, but only an eighteen-month lifetime for computer software and hardware investment is not uncommon.

Lowering the costs to develop new software solutions or extending the lifetime of software applications are two complementary approaches to addressing technological change. These goals can often be met by taking a declarative strategy when designing software systems independent of the programming methodology employed.

Issues with Imperative Programming

Most programming projects today use the imperative style of programming. Developers write sequences of operations in a language, such as C++, Java, Visual Basic, etc., that implement an algorithm, or recipe, for performing tasks. The algorithm for the task mixes logical, or relational, statements about the task to be solved and control statements about how to calculate the solution. The logical statements describe “what-to” calculate while the control statements describe “how-to” calculate. Debugging the algorithm consists of verifying the accuracy of the logical statements and fixing the control statements, if necessary.

There are many problems with the imperative approach. The sequence of operations critically determines the correctness of the algorithm. Unexpected execution sequences through an algorithm caused by user input actions or real-time events in a multitasking environment may result in subtle or catastrophic algorithm failure. Writing the control logic is the programmer’s responsibility and, therefore, subject to implementation errors. Understanding a program’s algorithm is often difficult for other developers without extensive metadata, or comments, on the code and empirical tracing of the program’s execution with sample data. Verifying program correctness consumes a significant portion of the development effort, but also usually fails to discover a significant number of defects.

To address the problems associated with imperative programming, the computer industry has developed and advocated many approaches. Structured programming and campaigns against “go-to” statements address some of the problems discovered with ad hoc control structures and statements. Modularization initiatives stress decomposition techniques on the premise that humans can better comprehend, reason about, and maintain smaller pieces of code. Object-oriented programming advocates program constructions using reusable components, libraries, and frameworks. The pattern programming school stresses analogies to other fields, such as architecture, by constructing programs using well-designed and crafted solutions, or patterns, that recur in many programming contexts.

What is Declarative Programming?

Declarative programming separates the logic, or what, of an algorithm from the control, or how, of an algorithm. The programmer still specifies the logic or equations specifying the problem’s relations, but the programming system is responsible for control, or how the logic is evaluated. The most familiar examples are spreadsheets and query languages for relational databases. The user, or programmer, specifies a mathematical relation as a query, say in SQL, for what to retrieve, while the database engine determines how to execute the query against the database.

There are many advantages to declarative programming over the imperative style. In declarative languages, programmers do not specify sequences of operations, but only definitions or equations specifying relations. Unlike imperative programming, the logic relations in declarative programming are execution order independent, free of side effects of evaluation, and semantically clear to visual inspection.

The declarative family of programming languages has a long history in the academic computer science community and specialized areas of commercial application, such as compiler construction, expert systems, and databases. Declarative languages have two main family trees. The logic declarative languages, such as Prolog, are based on first-order predicate calculus, which generalizes the notions of Aristotelian true or false values to statements, or predicates, involving relations among any entities. The other family branch consists of functional declarative languages, such as Miranda, Haskell, and SML. The functional declarative languages are based on the l-calculus developed by the mathematician, Alonzo Church in the 1930′s. l-calculus formalizes the notions of recursive application of pure functions to computable problems. Although not widely known as such, the latest programming fashion, XSLT, an extensible stylesheet language for transforming XML, is also a functional declarative language.

Despite the theoretical advantages of declarative programming languages, they do not have widespread use in commercial programming practice despite an attempt in the 1980′s by Borland to mass-market a PC version of Prolog along with the highly popular Turbo Pascal. There are many factors contributing to the infrequent use of declarative languages. A large contributor is the paucity of collegiate training in declarative languages, but awkward syntaxes of some languages, inefficient compilers and run-times, and restricted domains of applicability of generalized “how-to” mechanisms are all contributors.

Using Declarative Strategies in Commercial Software

While declarative programming languages have not received wide-spread commercial usage, the strategy of separating logic, or what, from control, or how, in an algorithm is a powerful, generalized technique for increasing ease of use and extending the longevity of software. Declarative techniques are particularly powerful in user interfaces and application programming interfaces (APIs) that have a rich, complex set of inputs over a relatively small field of execution behaviors.

Two examples of commercial software that illustrate the applicability of declarative techniques are DriverLINX and ExceLINX in the fields of data acquisition and test instrument control.

Using Declarations for Data Acquisition

DriverLINX is an API for controlling data-acquisition hardware used to measure and generate analog and digital signals interfaced to all types of external transducers. Data-acquisition applications include laboratory research, medical instrumentation, and industrial process control.

Traditionally, APIs for data-acquisition devices modeled the characteristics of the hardware design and had a large number of functions of one or more parameters to setup the hardware and control data flow through the system. The ordering of sequences of operations was often critical to correctly programming and controlling the hardware. Upgrading to new data-acquisition hardware was often costly as hardware-necessitated changes in the order of operation sequences to program the hardware required costly software changes.

To surmount these problems, DriverLINX takes an abstract and declarative approach to data-acquisition programming. Instead of modeling specific board designs, DriverLINX abstracts the functional subsystems of data-acquisition hardware into generalized attributes and capabilities. Programs request the measurement task they want to perform by parameterizing a “service request” declaration. The DriverLINX runtime determines how to satisfy the service request using the available hardware and returns the measurements as a packetized stream to the program. The data-acquisition programmer is relieved of any responsibility for data-acquisition algorithm control.

Besides relieving the programmer of control responsibility, the DriverLINX abstract, declarative approach gives the program syntactic and semantic interchangeability when migrating to equivalent hardware products. The abstract, declarative approach also helps isolate the software vendor from early technological obsolescence of change in the computer industry by focusing on the immutable logic of data-acquisition relations while the control mechanisms vary with software developments. DriverLINX has been a viable approach to data-acquisition programming for more than 12 years despite the market evolution from 16-bit Windows to .NET today.

Using Declarations for Test Instruments

Test instruments, such as digital voltmeters and electrometers, have evolved from simple devices with a front panel knob and display screen to sophisticated measurement processors performing dozens of measurement and control functions. Like data-acquisition devices, typically developers send a carefully ordered sequence of commands to an instrument to setup the measurement and then send additional command sequences to control the data flow of measurements from the instrument. The aforementioned problems for developers using imperative approaches to instrument control significantly limit ease of use and prohibit quick instrumentation solutions to short-term measurement needs.

ExceLINX is an add-in to Microsoft Excel that allows rapid specification of instrument test setups by using worksheet forms. Users specify, or declare, the channels, configurations, sampling rates, triggering, and data locations for the measurements they wish to perform by filling out an Excel worksheet. When the user selects the “start” button on the toolbar, ExceLINX translates the specification into the correct command sequence for the target instrument, initiates the measurement, and flows the data back to the requested worksheet. Users can setup and collect measurements by themselves in minutes using logic specifications compared to days or weeks using programmer’s time for imperative specifications.

Internally, ExceLINX also uses a declarative approach to handling the complex problem of field validation for the worksheet forms. Instruments have hundreds of parameters with complex overlaps among parameters. To validate whether the instrument supports the parameter set the user selected, ExceLINX maintains a dependency tree of allowed, disallowed, and unused parameters for every input cell on the worksheet. Each node in the tree also maintains logical relations among the selected set of parameters that ExceLINX evaluates at runtime to cross validate user input selections. Each supported instrument model has different parameter semantics, but ExceLINX can easily handle this complexity by switching model trees because the model-specific logic in the validation tree is separate from the shared control implementation in the ExceLINX code.

Declarative programming strategies that separate logic from control in algorithms are powerful techniques that can be used with today’s popular imperative languages. These techniques can make software more interchangeable, maintainable, usable, and endurable

Copyright Roy E. Furman, M.D., Ph.D 2005

About the Author

Roy Furman, M.D., Ph.D. is Director of Research and Development at Scientific Software Tools, Inc. He leads a team of software developers who have produced over 70 commercial software products for customers in the test and measurement, life science and healthcare industries. Visit their website, http//www.sstnet.com for articles and information on software development.

Backflip #1 in the Software Development Lab

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
This entry was posted in Development Tools. Bookmark the permalink.

82 Responses to Software Development Laboratory

  1. PDF Book says:

    Just keep doing good posts.

  2. I think that is among the such a lot important information for me. And i’m satisfied studying your article. However wanna statement on some basic issues, The web site style is wonderful, the articles is in point of fact nice :D . Good task, cheers.

  3. Very interesting site. Hope it will always be alive!

  4. Autokar says:

    I like this website very much, Its a really nice post to read and obtain information. “I leave this rule for others when I’m dead, Be always sure you’re right–then go ahead.” by Davy Crockett.

  5. poker star says:

    tout sur le dominos sur internet.|

  6. Yay google is my king aided me to find this outstanding site! . “Universities incline wits to sophistry and affectation.” by Francis Bacon.

  7. Location says:

    There are some interesting points in time in this article but I don’t know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article , thanks and we want more! Added to FeedBurner as well

  8. Perfectly written subject matter, regards for entropy.

  9. It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks

  10. Nice post, thank you. I signed to RSS on this blog.

  11. Very interesting points Software Development Laboratory
    | Cheap Dev Tools you have remarked, thanks for posting.

  12. I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here frequently. I am quite sure I will learn lots of new stuff right here! Best of luck for the next!

  13. Great post. Thanks for the helpful cheat sheets. Now maybe I’ll get my head wrapped around this stuff. Probably not, but it’s a goal. Gotta have them goals. http://www.samsung1080phdtv.net/

  14. You actually make it seem so easy along with your presentation however I find this topic to be actually one thing that I think I’d never understand. It seems too complicated and extremely large for me. I’m having a look forward for your next post, I¡¦ll try to get the dangle of it!

  15. Igre Online says:

    Thank You for the excellent article, I loved reading it!

  16. Thank you for sharing your thoughts. Greet!

  17. Well I really liked reading it. This subject procured by you is very helpful for good planning.

  18. As a Newbie, I am constantly browsing online for articles that can be of assistance to me. Thank you

  19. If you’re still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you’ll know which is right for you.

  20. Between me and my husband we’ve owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I’ve settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.

  21. Diaet says:

    very nice post, i certainly love this website, keep on it

  22. Browsergames says:

    Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.

  23. alkoholizm says:

    Thumbs up for this thread!

  24. I honestly knew about many of this, but with that said, I still considered it turned out practical. Beautiful blog!

  25. May i have a word of advice? I do believe youve got something great over here. However suppose you provided a few links to a site which backs up what you are you said? Or simply you might give us something to look at, whatever would associate just what youre talking about, something concrete?

  26. Good for you on having the single most state-of-the-art forums Ive come across in a few time frame! Its just fantastic the amount you will be able to gets rid of from something simply because of approaches visually beautiful its. Youve compiled a terrific weblog house –great visuals, video clips, blueprint. This is certainly a must-see weblog!

  27. Gussie says:

    Wow, wonderful blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is fantastic, let alone the content!

  28. Mi says:

    I have been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the web will be a lot more useful than ever before.

  29. escorte says:

    Hi there, I think your wordpress blog could possibly be having browser analysis issues. When I research your website in Look, it seems pleasant but when notch in The web Traveler, it has several overlapping. I basically desired to allow a short minds up! Other after that which often, superb website!

  30. There is obviously a lot to know about this. I think you made some good points in the Feature also.

  31. Characterized your website out of your acquaintances Fb linkage, plainly you have producing fanbase yet i also in these days undertsand one of the main reasons why Very academic article, many merit 1000000.

  32. I bought some true info here. I do think if more people consideration for it that way, they’d have got a better time have the hang ofing the situation.

  33. Jake Summers says:

    Great post. I was checking continuously this blog and I am impressed! Extremely useful info particularly the ultimate part :) I handle such info a lot. I was seeking this certain information for a long time. Thanks and good luck.

  34. My brother advised I’d of this nature internet page. He seemed to be entirely right. Piece of article actually made my morning. You can not imagine just how much time frame I actually had depleted because of this facts! Merit

  35. I basically tweeted your wordpress blog and wanted to say that I have really enjoyed reading this blog posts. By any means I’ll be subscribing to your rss now, thanks

  36. Klasse Informationen muss ich selbst mal testen.

  37. Pingback: free porn

  38. Pingback: create a website

  39. Wow, marvelous blog structure! How lengthy have you ever been blogging for? you make running a blog glance easy. The whole glance of your website is excellent, let alone the content!

  40. brukowanie says:

    Many thanks for this article. I will also like to state that it can become hard if you find yourself in school and merely starting out to create a long credit standing. There are many pupils who are simply just trying to endure and have long or beneficial credit history can occasionally be a difficult factor to have.

  41. Hello! I’ve been reading your site for a while now and finally got the courage to go ahead and give you a shout out from Humble Texas! Just wanted to tell you keep up the excellent job!

  42. Woah! I’m really digging the template/theme of this website. It’s simple, yet effective. A lot of times it’s very difficult to get that “perfect balance” between user friendliness and appearance. I must say that you’ve done a great job with this. In addition, the blog loads very fast for me on Opera. Superb Blog!

  43. I’m not sure exactly why but this web site is loading very slow for me. Is anyone else having this issue or is it a issue on my end? I’ll check back later and see if the problem still exists.

  44. iPad Game says:

    Howdy! Would you mind if I share your blog with my zynga group? There’s a lot of folks that I think would really enjoy your content. Please let me know. Many thanks

  45. I think one of your ads caused my web browser to resize, you might want to put that on your blacklist.

  46. Hello just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with internet browser compatibility but I thought I’d post to let you know. The layout look great though! Hope you get the problem fixed soon. Cheers

  47. 4aV7Hm Wow, great blog post. Much obliged.

  48. Neat blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple adjustements would really make my blog shine. Please let me know where you got your design. Thanks a lot

  49. The very root of your writing while sounding reasonable originally, did not really settle very well with me after some time. Somewhere within the paragraphs you managed to make me a believer unfortunately only for a short while. I however have a problem with your jumps in logic and one might do well to help fill in those breaks. In the event you can accomplish that, I will definitely end up being amazed.

  50. I know this if off topic but I’m looking into starting my own weblog and was wondering what all is required to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web savvy so I’m not 100% certain. Any suggestions or advice would be greatly appreciated. Thanks

  51. iPad Game says:

    Hey this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding skills so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!

  52. Hmm is anyone else having problems with the images on this blog loading? I’m trying to determine if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

  53. iPad Game says:

    Hey this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding expertise so I wanted to get guidance from someone with experience. Any help would be enormously appreciated!

  54. I absolutely love your blog and find most of your post’s to be exactly what I’m looking for. Would you offer guest writers to write content in your case? I wouldn’t mind creating a post or elaborating on a number of the subjects you write related to here. Again, awesome website!

  55. iPad Game says:

    Hey! This is my first comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading through your posts. Can you suggest any other blogs/websites/forums that cover the same subjects? Thank you!

  56. Thanks on your marvelous posting! I quite enjoyed reading it, you could be a great author.I will make certain to bookmark your blog and definitely will come back later on. I want to encourage you to continue your great posts, have a nice day!

  57. Hi there! Would you mind if I share your blog with my myspace group? There’s a lot of people that I think would really appreciate your content. Please let me know. Thank you

  58. I’m curious to find out what blog system you are using? I’m experiencing some small security problems with my latest blog and I’d like to find something more safe. Do you have any solutions?

  59. Please let me know if you’re looking for a author for your blog. You have some really great articles and I believe I would be a good asset. If you ever want to take some of the load off, I’d love to write some content for your blog in exchange for a link back to mine. Please shoot me an e-mail if interested. Cheers!

  60. I love your website, thanks for making it, Sincerely Jeff

    Dream Smile Center, Dr. Jeff Bartlett
    2440 East Sunrise Boulevard, Fort Lauderdale, FL 33304
    (954) 246-4126

  61. Software Development Laboratory
    | Cheap Dev Tools is a good posting. You have my vote regarding Software Development Laboratory
    | Cheap Dev Tools and I will bookmark this webpage now.

  62. iPad Game says:

    Hmm is anyone else having problems with the images on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

  63. Hi! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no back up. Do you have any solutions to stop hackers?

  64. I am curious to find out what blog platform you are using? I’m having some minor security problems with my latest site and I would like to find something more safe. Do you have any recommendations?

  65. Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!

  66. iPad Game says:

    Hello! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  67. My partner and I absolutely love your blog and find the majority of your post’s to be just what I’m looking for. can you offer guest writers to write content in your case? I wouldn’t mind composing a post or elaborating on a number of the subjects you write with regards to here. Again, awesome web log!

  68. Your blog does not show up appropriately on my blackberry – you might wanna try and fix that

  69. Cool:) I would say say it exploded my brain..!!

  70. Muchos Gracias for your post.Really looking forward to read more. Great.

  71. I really enjoy the article post.Thanks Again. Really Great.

  72. Your web site does not show up correctly on my blackberry – you might want to try and repair that

  73. Pingback: pikalaina

  74. Pingback: Vertaa Lennot

  75. Hipolito says:

    I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…

  76. stevia tom says:

    WONDERFUL Post.thanks for share.

  77. Alina says:

    so great, i like it.http://www.floresemesa.com

  78. Epic War 4 says:

    Software Development Laboratory
    | Cheap Dev Tools is a good article. I will spend more time studying this subject.

  79. samiy says:

    Oh my goodness! Incredible article dude! Thank you so much, However I am encountering problems with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anybody else getting the same RSS issues? Anybody who knows the answer will you kindly respond? Thanks!!

  80. I always was concerned in this topic and stock still am, appreciate it for putting up.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>