System Structures b Package b Abstract Data Type.

Slides:



Advertisements
Similar presentations
When is Orientated Programming NOT? Mike Fitzpatrick.
Advertisements

Components of GIS.
Chapter 13 – Introduction to Classes
Modules Program is built out of components. Each component defines a set of logically related entities (strong internal coupling) A component has a public.
4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
Chap-7 Robust_Input. A Package for Robust Input Read input values by calls to procedure Get overloading “Get” procedure for Integer and Float values There.
Abstract Data Types Data abstraction, or abstract data types, is a programming methodology where one defines not only the data structure to be used, but.
Generic programming Define software components with type parameters –A sorting algorithm has the same structure, regardless of the types being sorted –Stack.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Software Lifecycle A series of steps through which a software product progresses Lifetimes vary from days to months to years Consists of –people –overall.
CS 2511 Fall Features of Object Oriented Technology  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance.
Concurrency - 1 Tasking Concurrent Programming Declaration, creation, activation, termination Synchronization and communication Time and delays conditional.
1 Working with Classes Chapter 6. 2 Class definition A class is a collection of data and routines that share a well-defined responsibility or provide.
Abstract Data Types and Encapsulation Concepts
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
Classes in C++ Bryce Boe 2012/08/15 CS32, Summer 2012 B.
ITEC 320 Lecture 16 Packages (1). Review Questions? –HW –Exam Nested records –Benefits –Downsides.
Introduction to Object-oriented programming and software development Lecture 1.
Software components With special focus on DLL Software components1.
ITEC 320 Lecture 5 Scope Exceptions. Scope / Exceptions Review Functions Procedures.
CPSC- 120 Principle of Computer Science I Computer = Hardware + Software.
ADT ITEC 320 Lecture 22. ADT Review Generic lists –Ada compilation workout Recursive algorithms –What would a recursive copy look like? Project 4 is up.
Chapter 7 Other Loop forms, Procedures; Exception Handling.
Chap 7- Control Structures : The WHILE Statement.
Ch Ch jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes, notes, notes) Dr. Carter Tiernan.
Chap 5 Control Structure Boolean Expression and the IF Statement.
Data Abstaraction Chapter 10.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Objects & Classes Weiss ch. 3. So far: –Point (see java.awt.Point) –String –Arrays of various kinds –IPAddress (see java.net.InetAddress) The Java API.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Chapter 10, Slide 1 ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:  process abstraction  data abstraction Both provide:  information.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Chapter 6 Counting Loops; Subtypes In preceding chapters, 1.Sequence and 2.Conditional structures In this chapter, 3.Repetition, or iteration.
Architectural Styles, Design Patterns, and Objects Joe Paulowskey.
1 © AdaCore under the GNU Free Documentation License Franco Gasperoni
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
1 Chapter 11 © 1998 by Addison Wesley Longman, Inc The Concept of Abstraction - The concept of abstraction is fundamental in programming - Nearly.
1 CS Programming Languages Class 22 November 14, 2000.
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
1 Domain Management in a Hierarchical Generic Models Library University Pascal Paoli of Corsica SPE Laboratory Fabrice BERNARDI, Jean-François SANTUCCI.
Chapter 3 The General Structure of Ada Programs. General Form of an Ada Program With package1; With package2;... With packagen; Procedure pname IS - -
Slide 1 Chapter 6 Structures and Classes. Slide 2 Learning Objectives  Structures  Structure types  Structures as function arguments  Initializing.
SOLID Design Principles
Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 6-1 Learning Objectives  Classes  Constructors  Principles of OOP  Class type member.
CSE 2341 Object Oriented Programming with C++ Note Set #4
WITH Ada.Text_IO; PROCEDURE Three_Days IS | Finds yesterday and tomorrow, given today.
CSIS 123A Lecture 1 Intro To Classes Glenn Stevenson CSIS 113A MSJC.
Advanced Data Structures Lecture 1
Data Design and Implementation
Classes and Data Abstraction
Types for Programs and Proofs
Abstract Data Types and Encapsulation Concepts
Subtype Enumeration type
by Dharani Pullammagari
ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:
11.1 The Concept of Abstraction
Object Oriented Concepts -I
Lecture 2 of Computer Science II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Object Oriented Analysis and Design
Abstract Data Types and Encapsulation Concepts
copyright © Michael B. Feldman, All Rights Reserved
Copyright 2007 Oxford Consulting, Ltd
C:\> sort_3_numbers.exe |
Oriented Design and Abstract Data Type
11.1 The Concept of Abstraction
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

System Structures b Package b Abstract Data Type

Package b Essential programming tools b To develop a set of related operations and other entities, especially types, to test these thoroughly, and then to store them in an Ada program library for future use

Encapsulation b Grouping a set of related entities in a well- defined module, with a clearly specified interface to other program b The way, we produce software components that are pre-developed and pre-tested for reusability within an organization or distribution in the wider world

Abstract Data Type (ADT) b A special kind of package that groups a type together with a complete set of operations for that type

Example of ADT - - Partial Specification of Package Ada.Calendar PACKAGE Ada.Calendar IS - - Standard Ada package for dates and times Type Time IS Private; SUBTYPE Year_Number IS Integer Range ; SUBTYPE Month_Number IS Integer Range 1..12; SUBTYPE Day_Number IS Integer Range 1..31;

- - functions to get the current time - - and return its date components FUNCTION Clock RETURN Time; FUNCTION Year (Date: Time) RETURN Year_Number; FUNCTION Month (Date: Time) RETURN Month_Number; FUNCTION Day (Date: Time) RETURN Day_Number; END Ada. Calendar;

Displaying Today’s Date

Example Program With Ada.Text_IO; With Ada.Calendar; With Ada.Integer_Text_IO; Procedure Todays_Date IS Finds and Dislay Today’s Date -- RightNow : Ada.Calendar.Time; ---current time ThisYear : Ada.Calendar.Year_Number; --current year ThisMonth: Ada.Calendar.Month_Number; --current year ThisDay : Ada.Calendar.Day_Number; --current year

Begin RightNow := Ada.Calendar.Clock; ThisYear := Ada.Calendar.Year(Date => RightNow ); ThisMonth := Ada.Calendar.Month(Date => RightNow ); ThisDay := Ada.Calendar.Day(Date => RightNow ); Ada.Text_IO.Put (Item => "Today's Date is "); Ada.Integer_Text_IO.Put (Item => ThisMonth, Width => 1); Ada.Text_IO.Put (Item => '/'); Ada.Integer_Text_IO.Put (Item => ThisDay, Width => 1); Ada.Text_IO.Put (Item => '/'); Ada.Integer_Text_IO.Put (Item => ThisYear, Width => 1); Ada.Text_IO.New_Line; End Todays_Date;