Arden Objects Proposal Arden SIG Meeting Jan. 14, 2003 San Antonio, Texas Presented by Roger Corman.

Slides:



Advertisements
Similar presentations
An Approach to Dot Notation in Arden Syntax Tom Hooks – McKesson October 1, 2002.
Advertisements

1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Structure Query Language (SQL) COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
Java™ How to Program, 9/e Presented by: Dr. José M. Reyes Álamo © Copyright by Pearson Education, Inc. All Rights Reserved.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
VBA Modules, Functions, Variables, and Constants
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Introduction to Structured Query Language (SQL)
Chapter 81 Exception Handling Chapter 8. 2 Reminders Project 5 due Oct 10:30 pm Project 3 regrades due by midnight tonight Discussion groups now.
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
Introduction to Structured Query Language (SQL)
Fortran- Subprograms Chapters 6, 7 in your Fortran book.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Introduction To System Analysis and design
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Simplex method (algebraic interpretation)
WXGE6103 Software Engineering Process and Practice Formal Specification.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
1 Relational Algebra and Calculas Chapter 4, Part A.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
IS 230Lecture 6Slide 1 Lecture 7 Advanced SQL Introduction to Database Systems IS 230 This is the instructor’s notes and student has to read the textbook.
1 Relational Algebra Chapter 4, Sections 4.1 – 4.2.
For more notes and topics VISIT: IMPLEMENTATION OF STACKS eITnotes.com.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Management Systems Chapter 4 Relational Algebra.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts Extended Relational-Algebra-Operations Generalized Projection Aggregate Functions Outer Join.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Methods Methods are how we implement actions – actions that objects can do, or actions that can be done to objects. In Alice, we have methods such as move,
Update on the GELLO Expression and Query Language Margarita Sordo Brigham and Women’s Hospital Harvard Medical School HL7 Clinical Decision Support TC.
Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Function, Trigger used in PosgreSQL.
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
Java How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
1 Review for Midterm 2 Aaron Bloomfield CS 101-E.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
(C) 2010 Pearson Education, Inc. All rights reserved. Java How to Program, 8/e.
1 An SDL Tutorial Two primary elements: –Structure –Identifies the various components of the system, and the communication paths among them. –Components:
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Logical Database Design and the Rational Model
Chapter 5 Introduction to SQL.
Relational Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany)
Chapter 20 Generic Classes and Methods
Arrays in C.
Relational Algebra Chapter 4, Part A
MATLAB: Structures and File I/O
Relational Algebra 461 The slides for this text are organized into chapters. This lecture covers relational algebra, from Chapter 4. The relational calculus.
ISC440: Web Programming 2 Server-side Scripting PHP 3
Chapter 3 Introduction to Classes, Objects Methods and Strings
Python Primer 2: Functions and Control Flow
Chapter 9 Object-Oriented Programming: Inheritance
Chapter 6 Methods: A Deeper Look
Relational Algebra Chapter 4, Sections 4.1 – 4.2
Classes and Objects.
C++ Object Oriented 1.
Presentation transcript:

Arden Objects Proposal Arden SIG Meeting Jan. 14, 2003 San Antonio, Texas Presented by Roger Corman

Introduction This proposal follows the McKesson presentation by Tom Hooks at the previous Arden SIG meeting. This proposal follows the McKesson presentation by Tom Hooks at the previous Arden SIG meeting. It attempts to incorporate most of the ideas Tom presented in the Phase 3 approach. It attempts to incorporate most of the ideas Tom presented in the Phase 3 approach. Adds syntax for object definition. Adds syntax for object definition. Adds more formalism (B/N Forms) Adds more formalism (B/N Forms)

Introduction (cont.) This is still an incomplete proposal: a few issues are not covered and presumably will be topics of discussion.

Goals Simplify handling of query results. Simplify handling of query results. Keeping query results as a list of objects/records is often more convenient and intuitive. Keeping query results as a list of objects/records is often more convenient and intuitive. Creates a standard way to have named object/attributes in the system. This may allow platform-specific extensions to other objects to still share much of the object manipulation logic. Creates a standard way to have named object/attributes in the system. This may allow platform-specific extensions to other objects to still share much of the object manipulation logic. Maintain backward compatibility. Maintain backward compatibility.

Language Goals Keep added syntax/reserved words to a minimum. Keep added syntax/reserved words to a minimum. Any changes should work with existing Arden as seamlessly as possible. Any changes should work with existing Arden as seamlessly as possible. Coax the objects out of Arden, rather than impose a new model. Coax the objects out of Arden, rather than impose a new model. Simplicity. Simplicity.

Object Declaration Statement The OBJECT statement definition: := OBJECT [,... ]; := OBJECT [,... ]; LET BE OBJECT [,... ]; Field names are Arden identifiers. Example: MedicationDose := object [Medication, Dose, Status]; MedicationDose := object [Medication, Dose, Status];

Object Declaration Statement (cont.) Object declaration statements can only occur in the Data Slot, and they must occur prior to any use of the object type. This is similar to an MLM or DESTINATION declaration.

Object Declaration: Syntax Modifications Add OBJECT as an Arden reserved word. This is the only new reserved word being proposed, and possibly the only backward compatibility issue.

Object Declaration: Syntax Modifications In, added OBJECT option: ::= ::= "READ" "READ" | "MLM" <term | "FUNCTION" <term | "MLM" "FROM" "INSTITUTION" | "MLM" "FROM" "INSTITUTION" | "EVENT" | "EVENT" | "OBJECT" | "OBJECT" | "MESSAGE" | "MESSAGE" | "DESTINATION" | "DESTINATION" | "ARGUMENT" | "ARGUMENT" | "ARGUMENT" | |

Object Declaration: Syntax Modifications Added : Added : ::= ::= "[" "]" "[" "]" Added : Added : ::= ::= | "," | ","

Object Attribute References Implement “dot notation” for referring to attributes of objects. Implement “dot notation” for referring to attributes of objects. If an object attribute contains another object, the dots can be strung together. If an object attribute contains another object, the dots can be strung together.Example: patient.weight.units patient.weight.units

Object Attribute References: Dot Operator 9.12.xx Dot (binary) The dot (.) operator is used to select an attribute from an object, based on the name following the dot. It takes an expression and an identifier. The expression typically evaluates to a structure or a list of structures. Its usage is: :=. If the expression does not evaluate to an object, null is returned. If the expression evaluates to a list, normal Arden list handling is used and a list is returned.

Object Attribute References: Dot Operator (cont.) Dot Operator Example: NameType := object [FirstName, MiddleName, LastName]; /* Assume namelist contains a list of 3 NameType objects */ (“John”, “Paul”, “George”) := namelist.FirstName; (“Lennon”, “McCartney”, “Bush”) := namelist.LastName; “John” := namelist[1].FirstName; null := namelist[1].Height; (null, null, null) := namelist.Height;

Object Attribute References: Syntax Modifications Added “.” operator. This is at the same precedence level as the Element operator. ::= ::= | "[" "]" | "[" "]" | "." | "."

READ AS Statement READ AS is a structured READ. READ AS is a structured READ. Instead of returning a list of columns from a query, it returns a list of rows (objects). Instead of returning a list of columns from a query, it returns a list of rows (objects). The returned objects will match the type specified. The returned objects will match the type specified. := READ AS WHERE ; LET BE READ AS WHERE ;

READ AS Statement: Syntax Modifications In, added READ AS option: ::= ::= "READ" "READ" | "READ" “AS” | "READ" “AS” | "MLM" <term | "FUNCTION" <term | "MLM" "FROM" "INSTITUTION" | "MLM" "FROM" "INSTITUTION" | "EVENT" | "EVENT" | "OBJECT" | "OBJECT" | "MESSAGE" | "MESSAGE" | "DESTINATION" | "DESTINATION" | "ARGUMENT" | "ARGUMENT" | "ARGUMENT" | |

READ AS Example 1 Example: MedicationDose := object [Medication, Dose, Status]; med_doses := read as MedicationDose { select med, dosage, status from client where status != "inactive" }; { select med, dosage, status from client where status != "inactive" }; write med_doses; /* outputs something like the following */ [MedicationDose: Medication="Med1", Dose="Dose1", Status="Active"], [MedicationDose: Medication="Med2", Dose="Dose2", Status="Active"], [MedicationDose: Medication="Med3", Dose="Dose3", Status="Active"] write med_doses.Medication; /* outputs */ "Med1", "Med2", "Med3"

READ AS Example 2 Example: MedicationDose := object [Medication, Dose, Status]; med_doses := read as MedicationDose last ({ select med, dosage, status from client where status != "inactive" } where it occurred within the past 2 weeks); where it occurred within the past 2 weeks); write med_doses; /* outputs something like the following */ [MedicationDose: Medication="Med3", Dose="Dose3", Status="Active"]

Primary Time Attributes retain primary times, and expressions like: TIME OF Renal_function.BUN_level will work as expected. To be decided: Should objects have a primary time? To be decided: Should objects have a primary time?

Filtering Lists of Objects WHERE clause supports lists of objects. WHERE clause supports lists of objects. Attributes can be appended to "it" and "they" synonyms. Attributes can be appended to "it" and "they" synonyms. // List of objects returned Bp_r_arm := bp where it.site = "R Arm“; // Simple list returned Elevated_systolic := bp.systolic where it > 140;

Remaining Issues Object Time Object Time Object Value Object Value Assignment to attributes Assignment to attributes Assignment of objects (by value vs. by reference) Assignment of objects (by value vs. by reference) Behavior of other operators when passed objects. Most operators will only support attributes, and will treat an object as an unknown type. A few may need some appropriate behavior. Behavior of other operators when passed objects. Most operators will only support attributes, and will treat an object as an unknown type. A few may need some appropriate behavior.

Operator Modifications Aggregation operators such as LATEST, EARLIEST, MINIMUM, MAXIMUM can easily be applied to an attribute of a list of objects: Max := maximum of obj_list.attr1; However, Max now contains only the attribute value, not the object itself. We should probably specify how and when the object itself may be returned.

SORT We should specify a way to sort on any field. Sorted_list := sort data unsorted_list; Where could be any attribute, and the sorted list returned is a list of objects.

Object Time We may want to define a time for the object, so: TIME of obj is a reasonable expression. This allows LATEST and EARLIEST to work as expected, and helps make object use simpler in other places as well. Perhaps if all fields have the same time, this automatically becomes the object time, otherwise it is null.

Object Value In McKesson’s presentation, they suggested a default Value field, which would be used if no attribute was specified when objects were passed to Arden operators. I have some questions about this i.e. what if a list contains some objects and some non-objects. Does the value field of the objects get taken and the non- objects used directly? We need to think about this a bit.

Assignment of Attributes It is easy to implement assignment of attributes i.e. the left side of an assignment statement can use the dot notation. However, this comes back to the question of value/reference semantics which we brought up last meeting but has not been resolved.

Assignment of Attributes (cont.) Example: Assume x is an object with attribute a. y := x; x.a := 10; Question: Did y.a get modified? If we assume reference semantics of objects, then y.a also got modified. If we assume value semantics, then x.a and y.a are separate variables. I believe that reference semantics is more useful, powerful and convenient. It is used in most OO languages such as Java, C#, C++ (typically but not always since both are allowed), Common Lisp, VB.NET, Smalltalk, etc.

Creation of Objects It would be useful to be able to construct objects on the fly, rather than having to use lists to simulate them (as is typically done now). I have not proposed a syntax for object construction. The only way to obtain objects in this proposal is via the READ AS statement.