90 likes | 265 Vues
Ada 2005 By Demis Harper. Review. Created for use by Department of Defense Supports Object Oriented Programming Handles Multitasking Interoperable. Creating Objects. Type shape is tagged Record Area:float; End record; Type Circle is new shape with Record radius:float; end record;.
E N D
Ada 2005 By Demis Harper
Review • Created for use by Department of Defense • Supports Object Oriented Programming • Handles Multitasking • Interoperable
Creating Objects • Type shape is tagged Record Area:float; End record; • Type Circle is new shape with Record radius:float; end record;
Creating Objects • Example Declaration Circ:Circle; sh:shape; • Example assignments. circ.radius:=0.5; Circ:=(radius=>0.5); Circ:=(area=>0.7853,radius=>0.5); sh.area:=0.7853; Circ:=(sh with radius=>0.5);
multitasking • Protected Objects • Represent shared resources • (Object).acquire • Gets object for use • (Object).release • Object becomes available to other calls
Multitasking- Protected Objects • Protected Functions • Read only • Subject to read lock • Multiple function calls allowed on single object • Cannot change attribute values • Protected procedure • Subject to write lock • One procedure at a time • Can change attribute values
Multitasking • Re-queuing • Java-esque method to allows task to suspend itself. • Multitasking generally similar to Java Threading • Safer
Interoperability • Supports interfaces similar to Java and C# • Uses Object.Operation notation • “Unchecked Union” for inter-operating with C languages • Use of “limited with” to enforce dependence between types in different packages
References • Barbey, S., Kempe, M., & Strohmeier, A. (1993). Object-Oriented Programming with Ada 9X. Ada Home: the Home of the Brave Ada Programmers (HBAP). Retrieved November 26, 2012, from http://www.adahome.com/9X/OOP-Ada9X.html • Sanden, B. (2006). Intuitive Multitasking in Ada 2005. CrossTalk Magazine - The Journal of Defense Software Engineering - Home. Retrieved from http://www.crosstalkonline.org/storage/issue-archives/2006/200608/200608-Sandn.pdf • Taft, T. (2004, October). Ada 2005: Putting It All Together. adapower.com. Retrieved from http://www.adapower.com/files/articles/adagermany2004rev3.pdf