1 / 66

Declarative Programming and the Business Unit

M. D. Metadata Solutions. Declarative Programming and the Business Unit. Strategies for Custom Application Cost Reduction Dan McCreary Dan McCreary & Associates September 11, 2007. DISCLAIMER.

Télécharger la présentation

Declarative Programming and the Business Unit

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. M D Metadata Solutions Declarative Programming andthe Business Unit Strategies for Custom Application Cost Reduction Dan McCreary Dan McCreary & Associates September 11, 2007

  2. DISCLAIMER • The following views are my own and do not necessarily reflect the views of the Minnesota Department of Revenue or the State of Minnesota

  3. Presentation Abstract Title: Declarative Programming and the Business Unit Description: For the last few years software development has seen a dramatic growth in the use of XML in all aspects of information systems.  What began as a convenient way to store structured documents and server configuration files has morphed into complete systems that are built using only XML and XQuery. The amount of procedural code written in new systems is dropping dramatically.  This has had a large impact on the ability of business units to create and maintain their own requirements and business logic without the need for an extensive software development staff. This presentation discusses how XML has allowed business units to precisely capture the "what" (sometime graphically) without the need to be concerned with the "how" systems are implemented.  We will present a full example of a rich-client web application that has been defined and built using only a pure "declarative" style of model-driven software development.  These technologies include CSS, XForms, XML Schemas, XML Transforms, XQuery and business rules.  We will also discuss how pushing this power out to the business unit requires new data stewardship and business semantics skills to be emphasized.

  4. Audience Survey • How many people here… • Work for organizations that have web sites? • Are currently creating web applications? • Are familiar with XML syntax? • Have heard of the term “declarative”? • Are moving toward service orientation? • Have an enterprise service bus? • Have a metadata registry? • Regularly do ROI analysis on emerging technologies?

  5. web Incoming! Has this web thing gone away yet? XML

  6. How did we get here? • From punch cards… to tables… to trees… to cubes and graphs…

  7. In the Beginning… There were punch cards… …and there were 80 columns… and the widths were fixed… and batches of cards were called "decks“… and they were loaded into tables in “core” memory…

  8. And Codd and Date said… • Let there be relationships… Person Role Project person_id person_id project_id first_name project_id project_nm last_name role_nm description birth_date time_pct status and we had the relational databases… and we had SQL… and we had joins… and we had ER diagrams… and we had PowerBuilder… and all seemed right with the world…until

  9. Sir Berners-Lee Said… • Let there be HTML… <html> <head> <title>Dan’s Homepage</title> </head> <body> <h1>Welcome!</title> <p>Welcome to my web site!</p> <a href="about.htm">About Me</a> </body> </html> and we had URIs… and we had HTTP… and we had we links and resources… and we had trees (not tables)… and we had search…until

  10. Customers Said.. • We wanted to access our tables…on the web…in HTML! html ? head body h1 p a and there were objects… and there was Java and JSP … and there was ASP.Net and there were models, views, controllers… and there was conversion from forms to objects to tables and tables to objects to forms… and there were rooms and rooms of programmers…

  11. Name: Street: City: Zip: The Translation “Pain Chain” • From web forms to objects…to SQL inserts…to selects…to objects and back to web forms • Many format translations… • Impedance mismatch Web Forms Objects RDBMS

  12. And there Was Chaos… HTML Forms html Objects JSP/ASP head body Hibernate Serialization h1 p a 100+ Frameworks OR Mapping Struts JavaScript XML JDBC SQL .Net AJAX Sessions Stored Procedures And the number of languages you need to learn and the headcount of the IT departmentwent up…and up RDBMS

  13. Person FirstName LastName Roles Projects Project And the W3C Said… • Let their be simplicity…what if we…allowed you to put XML in the browser…and database html Database head body model input label

  14. Database Vendors that Support XQuery • IBM DB2 Version 9 “PureXML” • Microsoft SQL Server 2005 • Oracle 10g Release 2 Enterprise Edition • eXist (open source) • + 50 others…

  15. Evolution Metaphors • Specialization of Languages • Generalization of Languages

  16. Evolution: Specialization • Darwin’s Galapagos Finches • Beaks are highly adapted to different food sources • Finches adapted to specific ecological "niches“ over millions of years of isolated evolution • Similar to domain-specific declarative languages See Wikipedia "Darwin's Finches"

  17. Evolution: Generalization • Generalization: The Raccoon • The world has a higher population of raccoons today due to their ability to quickly adapt to changing urban environments • Similar to highly adaptive procedural languages

  18. Declarative <xf:input> <xf:label> Object Class MyClass( Method MyMethod Structured Fortran Function(A, B) Assembly FOR I = 1 TO 10 DO 1010001010 Computer Science Abstractions Higher abstractions time

  19. The Software Development Process Declarative Languages Requirements (BA) • Requirements are about “What” • Design and Build is about “How” Test (QA Staff) Design (Architect) Build (Programmer)

  20. A Declarative “System” Is… • A software development system, tailored to a specific domain (such as web applications), used to capture precise business requirements within the context of a problem domain (the implicit context) • Declarative systems do not specify how requirements are implemented to build working systems. Declarative systems only define the requirements • Declarative systems document requirements in specialized vocabularies and can be used to generate entire working systems including user interfaces, persistence and test data • Declarative systems specifically omitsome assumed requirements (such as system availability, performance, reliability, security etc) A Declarative system is a set of "little languages" with precise semantics that fit together like a puzzle to solve a problem

  21. http://www.w3.org/TR/REC-html32#body HTML, CSS and SQL xqueryversion"1.0"; <html><body> <h1>Old Expensive Books</h1> <ul>{ for$bookindoc("books.xml")//book orderby$book/title return <li> {$book /title}, {$book}/author}, {$book}/price}, {$book}/pubyear} </li> }</ul></body></html> /* global CSS used by all web pages */ body { font-family: Arial, Helvetica, sans-serif; font-size: 75%; margin: 0; padding: 0; width: 1000px; } h1 { color: blue; padding: 0 15px; } <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Declarative Systems</title> </head> <body> <h1>Introduction to Declarative Systems</h1> <p class="author">Dan McCreary</p> <p class="date">April 2007</p> </body> </html> • HTML, CSS, XQuery and SQL are declarative languages using these definitions • The semantics or “meaning” of each tag in the file is determined by an external organization • The syntax does not have to be XML HTML CSS XQuery -- Old expensive books SELECT title, author, price, pubyear FROM books WHERE price > 100 AND pubyear BEFORE ‘1960’ ORDER BY title SQL

  22. XML Schema Sample • Screen capture of Altova XML Spy • 30 minutes to learn graphical notation See: http://www.altova.com/products/xmlspy/graphical_xml_schema_editor.html

  23. XML Schema (XMLSpy Diagram) Solid linemeans required Data Element Sequence of items Dashed linemeans optional Cardinality Definition Graphical notation that most non-programmers can learn in 20 minutes.

  24. Use Case: Electronic Forms • User fills out a web-based form • Typical requirements may include listing of data to be gathered, data types, validation codes and data repetition patterns • Examples: • HTML Forms • XForms • InfoPath™

  25. RenderedForm XForms“Players” Mobile Client XFormsExtension Forms Server Netfront Mobile Forms Players <html> <head> <xf:model> <xf:/model> <head> <body> <xf:input> </xf:input> </body> </html> My-XForm.xhtml See Wikipedia “XForms”

  26. What Is Declarativeness for A Context? • Efficiency at capturing the testable business requirements in a semantically precise and concise manner • Example: Is a field optional? Will validation of the data fail if the field is missing? • Ability of each data element to have precise meaning over time and within organizations Schema Drawing Tool XML Schema File (.xsd) XForms xf|input:required {font-weight: bold;} xf|input:required .xf-value {background-color:#fff6af;} *:required::after {font-weight:bold; font-size:1.5em; content: "*"; color: red; } XForms CSS tags

  27. General Purpose Narrow Purpose Less Abstract More Abstract Declarative Spectrum • For any given context different “languages” have different levels of “declarativeness” • General purpose languages are less abstract but can solve a wide variety of problems • Declarative languages have a more narrow purpose and target a specific problem like styling a web page or selecting data CSS Apache Ant HTML C# AssemblyLanguage Python C C++ XSL XQuery XML Schema Java XUL XForms XPath Groovy JavaScript perl Ruby XQuery Update SQL

  28. Middle-Tiers Remain Procedural declarativeness • When the interface is consistent, declarative languages flourish • Middle tiers tend to have the most variation • Wikipedia lists over 200 web application frameworks • CMSMatrix.org lists over 700 content management systems user database Presentation/style (client tier) Business Logic (middle tier) Data definition, insert,selection and update (persistence tier) See: http://en.wikipedia.org/wiki/List_of_web_application_frameworks and http://www.cmsmatrix.org

  29. Semantics Constraints Presentation Query Workflow Forms Update Publish Build Transform The Application Development Puzzle

  30. Filling In Each PieceWith A Declarative Language Metadata Registry CSSHTML XMLSchema XQuery BPEL XForms XQuery Update Cocoon ApacheAnt XSL

  31. Semantically Precise Vocabularies See: http://en.wikipedia.org/wiki/Category:XML-based_standards

  32. Metadata Shopping Tools • You don’t need to know about 100,000 SKUs to purchase 10 items from a grocery store • Sub-schema generation tools give you exactly what you need and nothing more Phone Address FirstName See http://niem.gtri.gatech.edu/iepd-ssgt/SSGT-SearchSubmit.do

  33. If You Use Industry Standards…You Could Be Almost Done… • If you use industry standards… • and these standards publish their documents in XML Schema format… • and these standards have been transformed from XML Schema to XForms… • and you use native XML databases to store and XQuery to report on the data… • …then sample applications have been created and do not require additional procedural code • just change the constraints in the XML Schema and rerun the transforms See: http://www.exist-db.org See also: http://www.alphaworks.ibm.com/tech/purexml

  34. Architecture andStrategy (prevent unnecessaryprocedural code) ITArchitects ProceduralProgrammers Extend declarativevocabularies andprovide web service“glue” Business Analysts Precisely specifybusiness requirements Requires data stewardshiptraining SMEs and GUI Tools Users Accessibility Lower costs by moving routine logic maintenance to lower levels in the pyramid

  35. Java Libraries 10,000 class and 100,000+ methods available …but which ones are relevant to your business problem?

  36. “Less is More” • XForms 1.1 has only 21 XML elements • Much of the presentation of XForms is deferred to CSS • Event management is deferred to the XML Events • XML binding is deferred to the XBL standard Mies van der RoheReconstruction of theGerman Pavilion in Barcelona See Wikipedia “Minimalism”

  37. Bind Case Input Instance Group Help Hint Label Load Output Message Model Repeat Secret Select Select1 Switch Submission Submit Textarea Trigger XForms is Only 21 Elements Color coding limited vocabularies can increase the speed of pattern matching. Look for advanced text editors to provide custom element coloring.

  38. The New Semantics of "Nutshell" • The 1.4 release of Java 2 Standard edition increases the size of the platform by 50%, to 2,757 classes in 135 packages • 1.5 and 1.6 add additional classes 992 pages nutshell: something of small size, amount, or scope in a nutshell: in a very brief statement

  39. Procedural Programming is Not All “Poison” • It would be a mistake to tell all your procedural programmers that the programs they are creating are fundamentally evil • The relevant questions are: • How closely does it fit the problem domain? • Can BAs, SMEs and other non-programmers maintain the business rules? • What are the chances that others will be able to maintain it in future years? • How good are the development tools for your system?

  40. If You Give a Kid a Hammer… …the whole world becomes a nail • People solve problems using familiar tools • People develop specific Cognitive Styles* based on training and experience • What are we teaching the next generation of developers? * Source: Shoshana Zuboff: In the Age of the Smart Machine (1988)

  41. Semantics • The science of meaning • What you mean when you say “cat” • How do you associate meaning with symbols (verbal, physical, textual) • How do we know if we both mean the same thing when we use a word? • What if a word has multiple meanings? Reference: WordNet

  42. Semantic Triangle concept • Symbols can only link to referents through concepts • You can not link directly from a symbol to a referent “cat” symbol referent Wikipedia: Semiotic triangle

  43. Communication “cat” • Communication involves exchanging symbols that describe common attributes • A one-to-one match of attributes that describe a common symbol match implies a high precision match Domestic feline House pet Has fur Has whiskers Sometimes has fleas Chases mice Domestic feline House pet Has fur Has whiskers Sometimes has fleas Chases mice

  44. First name Last name Home address E-mail Cell phone number Gender Company name Home office address Branch office address CEO name Web site Industry code Same symbol – different meaning “customer” • Little match of common attributes • Low precision semantic match

  45. precise usage precise standard best vague usage precise standard better vague standard vague usage Not-so-good High and Low Precision • The ideal is to have a precise standard and to use the data elements exactly as they were intended

  46. Semantic Precision • Semantic mappings are relativein time and between groups of people (organization) • Semantic variability over time • Something that has precise meaning to you today may not have the same precise meaning a year from now • Our memories are imperfect and change over time • Semantic variability across organizations (project and organization) • A “customer” to one organization may denote a person but to another organization it may denote a company

  47. Semantics of an XML Data Element <code>47</code> • A developer puts an XML data element in an xml file • The tag has some meaning and the data within the tag has some meaning when it was created by the developer • What is the probability • That the developer will know the same meaning of the code 47 one year later • That another project that opens file will understand and be able to use the meaning of the tag • Vague standards often trigger vague interpretations of the meaning of data

  48. The Heart of the Enterprise The Metadata Registry A metadata registry is a central location in an organization where metadata definitions are stored and maintained in a controlled method. http://en.wikipedia.org/wiki/Metadata_registry

  49. Semantic Precision in Space and Time space: (projects, organizations) Large SemanticFootprint (long lifetimesystems) world enter-prise dept. team Small SemanticFootprint (rapid prototype) person time weeks months years 10+ years

More Related