TOPIC 1
Paradigms of Programming Unstructured (Unofficial Name) Structured Programming Procedural Programming Abstract Data Type OOP
Paradigms are valuable for solving problems because:  knowing one's paradigm reveals assumptions being made in modelling a problem, which can clarify programming objectives;  being able to state the advantages and drawbacks of various paradigms permits someone to decide between them based on the problem at hand.
goto  Statement Process Abstraction Function Declaration  Function Prototype (C/C++) The function name that is used in function call hides the implementation details from user. It shows only the outline of functionality that the function provides. Multi Entry and Multi Exit Subprogram Spaghetti Code
goto  less Programming Structured Theory Sequential  Selection Iteration Single Entry and Single Exit Subprogram Disadvantage:   over-used term for using complexity-reducing techniques (meaningless these days).
Modular Programming : The main program  coordinates calls to procedures in  separate  modules and hands over appropriate data  as  parameters  Functional independence, measured by: Internal cohesion (does/deals with one thing) External coupling (interface complexity) Makes modification easier Reduces error propagation
Definition of ADT : ADT , or  data abstraction , is a programming methodology where one defines not only the data structure to be used, but also the processes to manipulate the structure Data structure: represents the properties, the state or characteristics of objects Methods: permissible behaviors that are controlled through the member functions Showing only the essential features and hiding the unnecessary features
A data representation that must be able to represent all possible values of the ADT should be private A set of methods that support normal use of the ADT The user must be able to create, possibly modify, and examine the values of the ADT An algorithm for each of the possible operations that must be consistent with the chosen representation all auxiliary (helper) operations that are not in the contract should be private
The ability to define an ADT where the type and/or size is specified generically so that a specific version can be generated later In C++, parameterized ADTs are implemented as  template classes In C++, and also Ada, the parameterized ADT definition is generated at compile-time
Encapsulation is a technique that allows the programmer to group data and the functions that operate on that data and place them together in a single place. Encapsulation Constructs : For large programs, to avoid having to recompile all code when one section changes Code can be grouped into  logically related  chunks called encapsulations Each language has some technique for then using the named encapsulation, sometimes called a  namespace
Controlling access to the data structure through some form of interface so that it cannot be directly manipulated by external code This is often done by using two sections of an ADT definition the  public part  ( interface ) constitutes those elements that can be accessed externally the  private part , which remains secure because it is only accessible by subprograms of the ADT itself
C++ offers two mechanisms for building data structures:  the struct and the class C++ class  consists of  data members  and  methods (member functions) C++ classes contain both visible (public) and hidden (private) components (as well as protected) A stack-dynamic object may have heap-dynamic data so that parts of the object may continue even though the instant is deallocated
OO Concepts:  objects of the program interact by sending messages to each other Main Features of OOP : ADT Inheritance : Create a new class from an existing class Reuse, Extend and Overriding Function Permits objects of a more specific class to inherit the  properties (data) and behaviors (functions) of a more general/base class Ability to define a hierarchical relationship between objects
-  (True) Polymorphism : a bility for different objects  to interpret functions differently Dynamic Binding  Virtual Methods Pure Virtual Function Additional Feature  Generic Programming
Procedural Focuses on process Top Down approach A Single module will be split into several smaller modules General to Specific If the requirements are clear at the first instance we can go for Top down approach OOP Focuses on object Bottom Up approach Lot of small modules will be grouped to form a single large module Specific to General In circumstances where the requirements may keep on adding, we go for Bottom up approach
C++ is based on  Simula 67 and C Design by Kristen Nygaard and Ole-Johan Dahl Norwegian Computing Center, Oslo University The start of object-oriented programming and object-oriented design Model real-world phenomena in code represent ideas as classes and class objects represent hierarchical relations as class hierarchies Classes, inheritance, virtual functions, object-oriented design A program becomes a set of interacting objects rather than a monolith Has major (positive) implications for error rates
Compared to C++:  no header files, macros, pointers and references, unions, operator overloading, templates, etc. Object-orientation: Classes + Inheritance Distributed: RMI, Servlet, Distributed object programming. Robust: Strong typing + no pointer + garbage collection  Secure: Type-safety + access control  Architecture neutral: architecture neutral representation Portable Interpreted: High performance through  Just in time compilation + runtime modification of code Multi-threaded
C#, pronounced C Sharp, was developed by Microsoft as part of the .NET initiative The principal designer and lead architect is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal,  Borland Delphi, and Visual J++ It is a multi-paradigm language that include functional, imperative, OO and component-oriented disciplines C# is intended to be a simple, modern, general-purpose, object-oriented programming language. It was initially named Cool, which stood for "C-like Object Oriented Language." However, in July 2000, the name of the programming language was given as C#

Topic 1 PBO

  • 1.
  • 2.
    Paradigms of ProgrammingUnstructured (Unofficial Name) Structured Programming Procedural Programming Abstract Data Type OOP
  • 3.
    Paradigms are valuablefor solving problems because: knowing one's paradigm reveals assumptions being made in modelling a problem, which can clarify programming objectives; being able to state the advantages and drawbacks of various paradigms permits someone to decide between them based on the problem at hand.
  • 4.
    goto StatementProcess Abstraction Function Declaration Function Prototype (C/C++) The function name that is used in function call hides the implementation details from user. It shows only the outline of functionality that the function provides. Multi Entry and Multi Exit Subprogram Spaghetti Code
  • 5.
    goto lessProgramming Structured Theory Sequential Selection Iteration Single Entry and Single Exit Subprogram Disadvantage: over-used term for using complexity-reducing techniques (meaningless these days).
  • 6.
    Modular Programming :The main program  coordinates calls to procedures in  separate  modules and hands over appropriate data  as  parameters  Functional independence, measured by: Internal cohesion (does/deals with one thing) External coupling (interface complexity) Makes modification easier Reduces error propagation
  • 7.
    Definition of ADT: ADT , or data abstraction , is a programming methodology where one defines not only the data structure to be used, but also the processes to manipulate the structure Data structure: represents the properties, the state or characteristics of objects Methods: permissible behaviors that are controlled through the member functions Showing only the essential features and hiding the unnecessary features
  • 8.
    A data representationthat must be able to represent all possible values of the ADT should be private A set of methods that support normal use of the ADT The user must be able to create, possibly modify, and examine the values of the ADT An algorithm for each of the possible operations that must be consistent with the chosen representation all auxiliary (helper) operations that are not in the contract should be private
  • 9.
    The ability todefine an ADT where the type and/or size is specified generically so that a specific version can be generated later In C++, parameterized ADTs are implemented as template classes In C++, and also Ada, the parameterized ADT definition is generated at compile-time
  • 10.
    Encapsulation is atechnique that allows the programmer to group data and the functions that operate on that data and place them together in a single place. Encapsulation Constructs : For large programs, to avoid having to recompile all code when one section changes Code can be grouped into logically related chunks called encapsulations Each language has some technique for then using the named encapsulation, sometimes called a namespace
  • 11.
    Controlling access tothe data structure through some form of interface so that it cannot be directly manipulated by external code This is often done by using two sections of an ADT definition the public part ( interface ) constitutes those elements that can be accessed externally the private part , which remains secure because it is only accessible by subprograms of the ADT itself
  • 12.
    C++ offers twomechanisms for building data structures: the struct and the class C++ class  consists of  data members  and  methods (member functions) C++ classes contain both visible (public) and hidden (private) components (as well as protected) A stack-dynamic object may have heap-dynamic data so that parts of the object may continue even though the instant is deallocated
  • 13.
    OO Concepts: objects of the program interact by sending messages to each other Main Features of OOP : ADT Inheritance : Create a new class from an existing class Reuse, Extend and Overriding Function Permits objects of a more specific class to inherit the properties (data) and behaviors (functions) of a more general/base class Ability to define a hierarchical relationship between objects
  • 14.
    - (True)Polymorphism : a bility for different objects to interpret functions differently Dynamic Binding Virtual Methods Pure Virtual Function Additional Feature Generic Programming
  • 15.
    Procedural Focuses onprocess Top Down approach A Single module will be split into several smaller modules General to Specific If the requirements are clear at the first instance we can go for Top down approach OOP Focuses on object Bottom Up approach Lot of small modules will be grouped to form a single large module Specific to General In circumstances where the requirements may keep on adding, we go for Bottom up approach
  • 16.
    C++ is basedon Simula 67 and C Design by Kristen Nygaard and Ole-Johan Dahl Norwegian Computing Center, Oslo University The start of object-oriented programming and object-oriented design Model real-world phenomena in code represent ideas as classes and class objects represent hierarchical relations as class hierarchies Classes, inheritance, virtual functions, object-oriented design A program becomes a set of interacting objects rather than a monolith Has major (positive) implications for error rates
  • 17.
    Compared to C++: no header files, macros, pointers and references, unions, operator overloading, templates, etc. Object-orientation: Classes + Inheritance Distributed: RMI, Servlet, Distributed object programming. Robust: Strong typing + no pointer + garbage collection Secure: Type-safety + access control Architecture neutral: architecture neutral representation Portable Interpreted: High performance through Just in time compilation + runtime modification of code Multi-threaded
  • 18.
    C#, pronounced CSharp, was developed by Microsoft as part of the .NET initiative The principal designer and lead architect is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal, Borland Delphi, and Visual J++ It is a multi-paradigm language that include functional, imperative, OO and component-oriented disciplines C# is intended to be a simple, modern, general-purpose, object-oriented programming language. It was initially named Cool, which stood for "C-like Object Oriented Language." However, in July 2000, the name of the programming language was given as C#