Henrik Høltzer (heho)
Software Construction - SWC 1.1 1B

Semester: 1.sem., efterår 2017
Email: heho@easj.dk

Materialer generelt:

Noter:

Object-Oriented Programming with C# (findes på GitHub her)


Opgaver:

C# Programming Exercises (findes på GitHub her)

Unsolved exercise projects

Solved exercise projects


Supplerende materiale:

Microsoft Visual C# Step by Step (8th ed.), by John Sharp (ISBN: 9781509301041)

NB: Bogen er IKKE pensum

 

Video

Lynda.com (Gratis adgang; tilmeld med EASJ e-mail konto: https://www.lynda.com/email-signup) (SWC Lynda.com Playlist)

MS Academy: C# Fundamentals for absolute beginners

 

Lektier:

Installér Visual Studio 2017 (Enterprise Edition), findes på Microsoft Imagine (aka Dreamspark).

Installér også ReSharper og GitHub extensions

 

Andet:

Studieordning Datamatiker

Opgave-Oversigten

Læse-Oversigten

 

 

Uge Emner Materialer Opgaver
36

Velkommen til Datamatiker-studiet!

Generel intro til EASJ og studiet

 

Hyttetur (onsdag morgen - torsdag morgen)

Program for introduktion

Introduktion til EASJ og studiet

Introduktion til IT-systemer

Greenfoot 

 

Visual Studio (MS Imagine)
ReSharper
Git

Greenfoot-opgave
37

Overblik over Software Construction

Værktøjer og Materialer

I gang med Visual Studio

IT HW SW

Noter: s.6-20

HowTo make Visual Studio (with ReSharper) quiet...

Get.1
37

Programming - Part I

Code organisation
Types
Variables
Type conversion
Simple I/O
Arithmetic
Logic
Functions

Noter: s.21-36

(Bog: Kap. 1, 2)

Pro1.1 - Pro1.3
38-39

Object-Oriented Programming - Part I

What is OO?
Creating objects
Reference-type vs. value-type
Using properties and methods
Class definitions
Class collaboration
Static classes and methods

Studiestartsprøve

Noter: s.37-69

(Bog: Kap. 7)

OOP.1.1 - 1.7
40-41

Programming - Part II

Control statements
Debugging
Data structures
Code Quality (keeping code DRY)

Noter: s.70-110

 (Bog: Kap. 4, 5, 10, 18)

Pro.2.1 - Pro.2.15
42 Efterårsferie  
43-44

Object-Oriented Programming - Part II

Composition/Inheritance
Object construction
Overriding properties/methods
Polymorphic behavior
Abstract methods and classes
Interfaces
Exceptions

Noter: s.111-127

(Bog: Kap. 12, 13, 6 (i den orden))

OOP.2.1 - 2.6
ISpeak
44-45

GUI, XAML and Data Binding

XML/XAML
Simple GUI controls
Layout controls
Control properties
Data binding fundamentals
Collection views and Data binding
Master/Details view and Data binding
Commands

 

Noter: s.128-168

(Bog: Kap. 25, 26)

SimpleMVVMBinding.html
NoteMVVM.html
(GUI.1.0 - GUI 1.8)
45

MVVM Architecture

Single domain object
Collection of domain objects
Item view model
Master view model
Details view model
MasterDetails view model
Commands in MVVM

Noter: s.169-188

(Bog: Kap. 26)

Databinding Part1
Databinding Part2

Other Interesting MVVM-links
Windows 10 Development for Absolute Beginners
Windows 10: Data Binding
A-Totally-Simple-Introduction-to-the-MVVM-Concept
MVVM-Pattern-in-WPF-A-Simple-Tutorial-for-Absolute-Beginners
WPF-MVVM-Quick-Start-Tutorial
wpf-mvvm-pattern-a-simple-tutorial-for-absolute-beginners
http://wpftutorial.net/DataGrid.html
WPF Apps With The Model-View-ViewModel Design Pattern
Simple MVVM Walkthrough – Part I
MVVM Made Simple
How to Listen to Property Changes of Items of an ObservableCollection
Controls by function (Windows Store apps using C# and XAML)

(GUI.2.0 - GUI.2.3)

C#-Projects:
RelayCommand.zip
RelayArgCommand.zip
46

Bindings
MVVM Design Pattern

MSDN: Commands, RelayCommands and EventToCommand
EventToCommand is now built into Windows 8.1!

Other Interesting XAML-links (about ListView and GridView)
Quickstart: adding ListView and GridView controls (XAML)
How to group items in a list or grid (XAML)
Data Templating overview (DataTemplate, ItemTemplate)

Designing Your XAML UI :
XAML for Windows 10: Layout NEW!
XAML for Windows 10: Items Controls NEW!


46



Persistens:
Filer/Serialisering




MSDN: Basic Serialization

Windows App Store:
MSDN: StorageFolder

Exercise:
SerializationTest

Exercise:
Implementer persistens i Note App'en se: NoteMVVM.html
Dvs. det skal være muligt at hente og gemme Noter på fil.

Bemærk:
I windows App er der ikke adgang/rettigheder til filsystemet direkte, dvs der kan ikke umiddelbart streames (serialiseres) til en hvilkårlig fil. I stedet kan benyttes localstorage, der fås adgang til via class StorageFolder/StorageFile.

Følgende skriver localdata til filen Data.txt i localstorage:
StorageFile localFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("Data.txt", CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(localFile, localData);

Filen kan findes på harddisk her: C:\Users\{user}\AppData\Local\Packages\7bbfef26-f6ac-4a10-9fed-4abfefafca86_18sn2ae6rna7w\LocalState.



C#-Projects:
SerializationTest.zip
NoteMvvnPersistency.zip
WindowsAppSerializeTest.zip

47

Async, Task, Await

MSDN: Asynchronous Programming with Async and Await
CodeProject: Asynchronous Programming in C# 5.0 using async and await

Don't Block on Async Code

Slides: ProcessesAndThread (PowerPoint)
Slides: AsynchronousPrograming (PowerPoint)

C#-Projects:
GuiExampleAsyncAwait
SimpleBrowserAsync
47 Exceptions


MSDN Exceptions and Exception Handling (C# Programming Guide)
MSDN
Gracefully Handling Exceptions -21 (video)
Exceptions (PowerPoint)



Exceptions and Exception Handling in C#


Exercise:
I programmet SerializationTest.zip fra uge 46 blev der testet en simpel Reading og Writing til en FileStream, men uden brug af Exceptions-håndtering. Udvid programmet så der nu bliver implementeret en Exception-håndtering (fx håndtering af FileNotFoundException og DirectoryNotFoundException)

Exceptions-Stack

C#-Projects:
WindowsAppSerializeTestV2.zip
(nu med håndtering af FilNotFoundException)


Solutions:
MyStack.zip

48-50 Projektarbejde  
51

Projektaflevering (18/12)

 

Repetition/Spørgetimer

 
2 Eksamen 9-10. januar 2018