Download presentation
Presentation is loading. Please wait.
Published byCurtis Randles Modified over 10 years ago
1
PQL Programming using Object- Oriented Methods Randy Banks (randy@essex.ac.uk)randy@essex.ac.uk ISER, University of Essex http://www.iser.essex.ac.uk
2
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Outline What is Object-Oriented Design (OOD)? OOD concepts and tools - Unified Modelling Language (UML) OOD & SIR/PQL Real-life example – SIR/SDSX
3
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. What is OOD? OOD is conceptual modelling technique (like Entity- Relationship Modelling (ERM)) ERM is for database design OOD is for just about anything –Abstract, generalisable, thus applicable to extremely wide range of software engineering problems –ERM on steroids … and 10 fruit portions a day OOD helps build code that is –Reliable –Reusable –Maintainable –Robust
4
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. How does it work? OOD decomposes universe of discourse into classes, objects and associations between them Classes are ‘templates’ for the creation of objects Objects are ‘instantiations’ of a class Associations relate classes/objects to each other
5
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Classes/Objects May have properties (attributes) and/or methods (operations) Properties store information about an object, e.g. variables Methods accomplish tasks, e.g. functions Packages used to organise and group related classes and provide contained namespace
6
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Methods and Properties Scope is local to class in which defined –impact of change can be controlled Access by other methods (of other classes) may be more or less restricted –Private - available only to methods of same class –Protected - available to methods of same and ‘child’ (later) classes –Public - available to method in any class
7
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Types of Associations Bog-standard (untyped) Dependency (very weak) Aggregation (objects of one class are ‘part of’ objects of another) Composition (objects of one class are ‘made up of objects of another) Inheritance (objects of one class (the ‘child’) share the properties and methods of another (the ‘parent’) – ‘is-a’ relationships
8
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Properties of Associations Roles –Indicates what the association, and the associated elements, do Direction –Defines which way information/messages flow between objects of one class and objects of another Multiplicity (cardinality) –Specifies how many objects of one class are related to objects of another
9
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Unified Modelling Language (UML) Standard –To support OOD –Maintained by Object Management Group (OMG) (ultimate goal is to) Provide concepts and diagrams to cover all aspects of the development process –from user requirements to on-going maintenance The Microsoft {SAS,IBM} of Modelling For example …
10
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD Example. Conference Drinks - Classes
11
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD Example. Conference Drinks - Objects
12
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Object-Oriented Programming Languages (OOPLs) OOPLs more or less implement OOD concepts – of which there are many more than described above Many benefits to OOPLs –‘code control’ PQL is not an OOPL OOD concepts can be mapped on to PQL OOD methods can be used to design PQL applications here’s one I made earlier …
13
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD & SIR/PQL. Classes Classes can be implemented as PQL procedure Families –As PQL is not an OOPL, no distinction between classes and objects Methods can be implemented as PQL Subroutines –Procedures, too, but no localisation –alas, no functions Properties can be implemented as PQL External Variable Blocks
14
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD & SIR/PQL. Associations Nothing in PQL to implement associations Associations are realised by executing subroutines –or calling procedures Can realise inheritance by defining family name of a subroutine at compile time E.G. …
15
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD & PQL. Inheritance PROCEDURE PARENT.INHERIT SUBROUTINE.METHOD pql code … END SUBROUTINE END PROCEDURE PROCEDURE CHILD.COMPILE CALL PARENT.INHERIT(CHILD) more child subroutines, etc END PROCEDURE CALL CHILD.COMPILE
16
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. OOD & PQL. Inheritance Qualification Use above technique judiciously –No protection of inherited methods … get all or nothing … –… which may conflict with methods specific to child ‘class’
17
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. A Real-life Example. SIR/SDSX Problem –Generic, software-independent means of storing/transferring survey metadata, including SIR/DBMS schema information Solution –SDSX (Survey Delivery System Exchange Format or Survey Delivery System XML Transfer Format or … whatever …) Similar objectives to DDI (Data Documentation Initiative XML format SIR/SDSX –Application to write database schema information into SDSX format SDSX and SIR/SDSX are ‘in progress’
18
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SDSX. Specification
19
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SIR/SDSX. User Interface
20
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SIR/SDSX. Database Package
21
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SDSX. Record Package
22
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SIR/SDSX. Variable Package
23
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SIR/SDSX. Anywhere Package
24
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. SIR/SDSX. General Package
25
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. Summary OOD provides general purpose methods to solve a variety of software engineering problems Very popular – lots of information, methodologies & tools Even though PQL is not an OOPL, OOD can be applied to PQL applications development Value of approach can only be judged by results –More work at the design stage, less hassle later –Effectiveness depends on how applied... art and science (methodology) are both necessary (cf. Clausewitz, On War; Tolstoy, War and Peace)
26
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. See also, for … OOD, OO Methodology, UML –http://www.google.*http://www.google.* –Agile Modeling (http://www.agilemodeling.com/)http://www.agilemodeling.com/ –Object Management Group (http://www.uml.org/)http://www.uml.org/ –a nice glossary of OO terms (http://www.microgold.com/version2/stage/tutorial/glossary.html)http://www.microgold.com/version2/stage/tutorial/glossary.html –Journal of Object Technology (http://www.microgold.com/version2/stage/tutorial/glossary.html)http://www.microgold.com/version2/stage/tutorial/glossary.html –UML resources from SparxSystems (http://www.sparxsystems.com.au/resources/)http://www.sparxsystems.com.au/resources/ –Bruegge & Dutoit. Object-Oriented Software Engineering –Alhir. Learning UML UML Tools –http://www.google.*http://www.google.* –Enterprise Architect (http://www.sparxsystems.com.au/) – my favourite; excellent value for ££http://www.sparxsystems.com.au/ –Poseidon (http://gentleware.com/index.php) – ‘Community Edition’ is freehttp://gentleware.com/index.php XML –http://www.google.*http://www.google.* –W3C (http://www.w3.org/XML/)http://www.w3.org/XML/ –W3 Schools XML tutorial (http://www.w3schools.com/xml/)http://www.w3schools.com/xml/ –Ray. Learning XML Data Documentation Initiative –Home Page (http://www.icpsr.umich.edu/DDI/)http://www.icpsr.umich.edu/DDI/ General Information –W3 Schools (http://www.w3schools.com/)http://www.w3schools.com/ –Tolstoy. War and Peace –Clausewitz. On War Sheer entertainment value –NTK (http://www.ntk.net/)http://www.ntk.net/ –World Wide Words (http://www.worldwidewords.org/)http://www.worldwidewords.org/
27
PQL Programming using Object-Oriented Methods. SIR Users Group Conference, June 28-30, 2006, Stratford. That’s all folks
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.