Introductory Programming With C#: Judith Bishop
Introductory Programming With C#: Judith Bishop
with C#
Judith Bishop
University of Pretoria, South Africa
Visiting TU-Berlin
Introduction
– Who, why, when, how, with what?
Assessment
– Quizzes, exercises, laboratories, exams
References
Debugging New
Inhibitors to change
– Lack of teaching resources
– Computing resources required by new technology
– Investment in current language
– Uncertainty over the measure of improvement
A suggestion
– threads - in Operating Systems
– networking - for Netcentric Computing
– graphics and delegates - to introduce non-Views GUIs
– operator overloading, other upcoming features (e.g. generics), - in
Data Structures
Notes:
– Topics that were in a Java introductory course might not be in a C#
version (applets)
– NOTE: some institutions will start with Netcentric Computing -
interesting approach
Option 2 (Lecturer)
– a PC with lots of memory
– Visual Studio
Option 3 (Researcher)
– PC or Mac, Windows or Linux
– Rotor
– Any simple editor
OPTIONS
Create GUIs by hand
– error prone
– takes too much time
The reality of a
Views single cross-language,
cross-platform
GUI interface programming model
is in sight, based on an
XML description language
supported by
fast native runtimes.
[Russel Jones, DevX, Nov 2002]
System.Data
System.Xml
(ADO.NET)
System
SDK Tools
Platform Abstraction
Microsoft Courses 2003 24
Views
Application
GUI
GUIBuilder
Builder
Add
AddListeners
Listeners
Handlers
Visual Studio
C#
Control
Engine
Add
AddListeners
Listeners
No pixel positioning
No generated code
Separation of concerns
Microsoft Courses 2003 30
Example 2
int luckyNumber =
int.Parse(v.GetText("Number"));
Random r = new Random (luckyNumber);
for( ; ; ) {
string s = v.GetControl( );
if (s==null) break;
DateTime luckyDate =
new DateTime(DateTime.Now.Year, r.Next(3,12);, r.Next(1,30););
v.PutText("Day", "Your lucky day will be " +
luckyDate.DayOfWeek + " " + luckyDate.ToString("M"));
}
Microsoft Courses 2003 31
Other Views examples
Calculator
– Compare with text version
– Separation of concerns
– Internationalization
PhotoAlbum
– Fun with pictures
Exception handling
Robust code
– simple logic
– validity checks - also with Assert
– tracing statements
Debugger programs
– Text based, or
– GUI, with or without Visual Studio
Page 318
Students, staff, posgrads and tutors have different
rules for access to a building. The rules are
implemented at the start of each year.
Polymorphic collection over IAccess
Classic simple data update example
Can be much extended e.g. for
– serialisation
– images
Quizzes
– available online on the website
Exercises
– at the end of each chapter - answers will be provided to lecturers
Practicals
– worksheets are being devised based on the book
Exam questions
– samples will also be provided
Forward looking
– Move to platform independent GUI systems
– Integration of XML into languages (cf XEN)
Technical
– Rotor does not have a GUI capability
– Interesting challenges in Reflection, RegEx etc
Educational
– Dissatisfaction with method-oriented or drag and drop GUIs
– Separation of concerns
Extension, polymorphism
D1(P)
Delegation D2(Q)
D3(R)
F(D1) -- calls P
F() -- calls M F() -- calls M via M
I A D
M M
M C
A B
A B C B C P Q R
M M M M M
Application
GUI
GUIBuilder
Builder
Add
AddListeners
Listeners
Handlers
Visual Studio
C#