Download presentation
Presentation is loading. Please wait.
Published byMaude Riley Modified over 8 years ago
1
Object Oriented Programming Course Introduction Dr. Mike Spann m.spann@bham.ac.uk
2
Course Introduction This course introduces you to object oriented programming using C# and the.NET programming environment This course introduces you to object oriented programming using C# and the.NET programming environment It also teaches you a few more advanced techniques such as graphics/multimedia programming and web form programming It also teaches you a few more advanced techniques such as graphics/multimedia programming and web form programming You will be introduced to object oriented design techniques using UML notation You will be introduced to object oriented design techniques using UML notation
3
Course Introduction The course will consist of lectures, tutorials and an un-assessed programming exercise The course will consist of lectures, tutorials and an un-assessed programming exercise It is assessed by a major programming assignment only (no exam!) It is assessed by a major programming assignment only (no exam!)
4
Recommended Textbook There are already dozens of textbooks on C# There are already dozens of textbooks on C# You need to choose one which suits you and your budget You need to choose one which suits you and your budget The course recommended book is: The course recommended book is: Visual C# 2010. How to Program. 3 rd Edition. H.M. Deitel, P.J. Deitel Published by Pearson ISBN 0-13-701183-0 It has everything there but is rather long and glosses over some important detail at times Amazon Link Amazon Link Amazon Link
5
Course resources Course web site Course web site Course web site Course web site Visual studio home page Visual studio home page Visual studio home page Visual studio home page Visual C# developer centre Visual C# developer centre Visual C# developer centre Visual C# developer centre Visual C# basics Visual C# basics Visual C# basics Visual C# basics
6
Course contents(Week 1) Course Introduction Course Introduction Introduction to C# Introduction to C# Classes and Objects Classes and Objects Inheritance and Polymorphism Inheritance and Polymorphism Interfaces, Callbacks, Delegates and Events Interfaces, Callbacks, Delegates and Events Graphical User Interfaces Graphical User Interfaces Graphics and Multimedia Graphics and Multimedia Multi-threading Multi-threading Files and Streams Files and Streams Windows Forms and ASP.NET Windows Forms and ASP.NET
7
Visual Studio Visual Studio 2013 is now installed on the School network and it is recommended that you use that for your assignment Visual Studio 2013 is now installed on the School network and it is recommended that you use that for your assignment Do not use the express version! You can install VS2013 on your laptop for free using the University MSDN agreement You can install VS2013 on your laptop for free using the University MSDN agreement Go to https://www.epsit.bham.ac.uk/software/msdn-aa/ https://www.epsit.bham.ac.uk/software/msdn-aa/
8
Object Oriented Programming (OOP) Introduction OOP: Now the dominant way to program, yet it is over 40 years old! (Simula '67 and Smalltalk '72 were the first OOPLs) OOP: Now the dominant way to program, yet it is over 40 years old! (Simula '67 and Smalltalk '72 were the first OOPLs) Dr. Alan Kay received ACM’s Turing Award, the “Nobel Prize of Computing,” in 2003 for Smalltalk, the first complete dynamic OOPL It was slow to catch on, but since the mid-90’s everybody’s been doing it! It was slow to catch on, but since the mid-90’s everybody’s been doing it! OOP emphasizes objects, which often reflect real-life objects OOP emphasizes objects, which often reflect real-life objects have both properties and capabilities i.e., they can perform tasks: “they know how to...”
9
OOP Introduction A simple way to think about designing and implementing a system using OOP is to ask the following 3 questions about your proposed system: A simple way to think about designing and implementing a system using OOP is to ask the following 3 questions about your proposed system: What are the system’s objects? What do those objects know how to do? What properties do those objects have?
10
Examples Digital watch Digital watch A B
11
Examples (Digital watch) What are the objects? What are the objects? watch display, buttons A (set mode), B(adjust time), timer Capabilities: What do those objects know how to do? Capabilities: What do those objects know how to do? watch display: be created display the time or hours/minutes digits individually button A: sets/resets display mode button B: sends message to watch display to increment/decrement hours/minutes digits
12
Examples (Digital watch) What properties do those objects have? What properties do those objects have? watch display: size background colour text fonts flash on/off display mode button A, button B: size colour
13
Examples Traffic light controller Traffic light controller
14
Examples (Traffic light controller) What are the objects? What are the objects? lamp controller, sequencer, traffic sensor, priority scheduler Capabilities: What do those objects know how to do? Capabilities: What do those objects know how to do? lamp controller: be created turns red, amber, green lamps on and off sequencer: be created sends on/off signal to lamp controllers in correct sequence and at correct times
15
Examples (Traffic light controller) Capabilities: What do those objects know how to do? (cont) Capabilities: What do those objects know how to do? (cont) traffic sensor: be created determines mean vehicle count per unit time priority scheduler: be created sends on/off signal to lamp controllers in correct sequence and at correct times
16
Examples (Traffic light controller) What properties do those objects have? What properties do those objects have? lamp controller: sequencer: sequence intervals traffic sensor: averaging window size priority scheduler: traffic through-put requirements
17
Examples Tetris Tetris
18
Examples (Tetris) What are the objects? What are the objects? piece, board Capabilities: What do those objects know how to do? Capabilities: What do those objects know how to do? piece: be created fall rotate stop at collision board: be created remove rows check for end of game
19
Examples (Tetris) What properties do those objects have? What properties do those objects have? piece: orientation position shape color board: size rows
20
So what is object oriented? In OOP, objects are considered anthropomorphic In OOP, objects are considered anthropomorphic the object has both storage and behaviour to operate on its current state eg bed can make itself, door can open itself, menu can let selections be picked but, each must be told when to perform actions by another object — so objects must cooperate to accomplish task Each object represents an abstraction Each object represents an abstraction a “black box” - hides details you do not care about allows you as the programmer to control program’s complexity — only think about salient features
21
So what is object oriented? So, OOP involves writing programs by modeling the problem as set of collaborating components So, OOP involves writing programs by modeling the problem as set of collaborating components you determine what the building blocks are think about the object, their behaviour and their properties put them together so they cooperate properly think about how they interact with other objects A simple analogy is like building with smart Legos, some of which are pre-defined, some of which you design! A simple analogy is like building with smart Legos, some of which are pre-defined, some of which you design!
22
What exactly is OOP? 3 components: 3 components: Data abstraction implementation, interface Encapsulation ‘packaged’ objects controlled interaction with other objects Polymorphism (‘many forms’) objects can assume ‘many forms’ through same interface
23
Why OOP? Allows the management of complexity. How? Controlled object behaviour and interactions as defined by the object state. Allows for extendibility and re-usability. How? Classes are packaged with well defined interfaces and hidden implementations.
24
OOP Applications What is OOP good for? Modelling asynchronously interacting objects. Eg: GUIs Event simulation Ray tracing visualisation CAD simulation Real-time control/embedded systems Robotics Image/Video processing Client/Server systems
25
OOP Applications What is OOP not good for? Mathematical programming (use MATLAB or MATHCAD!) Data processing
26
youtube Intro to OOP http://www.youtube.com/watch?v=OQjPcS 1tkDQ http://www.youtube.com/watch?v=OQjPcS 1tkDQ http://www.youtube.com/watch?v=OQjPcS 1tkDQ http://www.youtube.com/watch?v=OQjPcS 1tkDQ
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.