Dependency and its role in modern programming languages Antony Harfield 8 th January 2010.

Slides:



Advertisements
Similar presentations
Svetlin Nakov Director Training and Consulting Activities National Academy for Software Development (NASD) ASP.NET 3.5 New Features.
Advertisements

Adobe Flex as RIA Adobe Flex as RIA Developed by Sagar K Developing Rich Internet Applications with Adobe Flex, ActionScript.
Ronnie Saurenmann Job title: Cant live without Silverlight Microsoft Switzerland 4 Overview.
Natural Business Services for Construct Users Mark Barnard R&D Manager – Natural Business Services.
Brown University Swim Center
Win8 on Intel Programming Course Desktop : WPF Cédric Andreolli Intel Software
WHAT IS ANDROID? A Software platform and operating system for mobile. Based on the Linux kernel. Android was found way back in It was developed.
Office 2010 Software Applications in Office 2010 & Files.
INTRODUCTION TO JAVAFX CS12420 – Software Development Andrei Stanica (modified ltt)
Chapter 1 Introduction to Visual Basic Programming and Applications 1 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta.
Silverlight is a cross-browser, cross-platform plug-in* * An auxiliary program that works with a software package to enhance its capability. For example,
Lecture 12: Web Services MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET Objectives “Web Services are objects callable across a network.
Creating Windows Store Apps. 1. Overview of Windows Store applications 2. Worked example 3. Adding controls and event handlers Contents 2.
The Microsoft Technical Roadshow 2006 Windows Presentation Foundation (WPF) Marcus Perryman
WPF vs Silverlight Stuart Haas. WPF  Windows Presentation Foundation  Included in Vista, Server 2008 and XP service pack 2  Deployed in desktop and.
The Designer Tools Landscape Andy Hood. AKQA PROVIDES DIGITAL BUSINESS SOLUTIONS We focus on providing our clients with a return on investment.
1 Introduction to Silverlight 1.1 Mark Smith
Dependency in action A look at how dependency is used in modern programming languages Antony Harfield 22 nd October 2009.
An Introduction To Silverlight Gergely Orosz
1 1 Silverlight is a web browser plug-in. 2 2 There are two versions September 2007~October 2008 V2 is backwards compatible & where you’d start today.
Windows Presetation Foundation (WPF) 1. Introduction.
Chalermvong Vijitpiyakul Microsoft MVP Greatfriends.biz Community Lead GF 30 August 2009.
The Microsoft’s solution for building cross-platform Rich Internet Applications.
Object Oriented Software Development 1. Introduction to C# and Visual Studio.
Software Development. Chapter 4 – Windows application interfaces.
1 Networks and the Internet A network is a structure linking computers together for the purpose of sharing resources such as printers and files Users typically.
2 A First Look at Windows Presentation Foundation Everywhere ("WPF/E") Joe Stegman Lead Program Manager Microsoft Corporation.
Daniel Levy Solutions Consultant, Telerik Testing Tools Division.
RIA & Adobe Flex Yunhui Fu 11/05/2008. What’s RIA RIA (Rich Internet Applications) –web applications which look and perform like desktop applications.
Introduction to Silverlight By Alan Cobb 2008-Jan-10 Sacramento, CA
Introduction to Silverlight. Slide 2 What is Silverlight? It’s part of a Microsoft Web platform called Rich Internet Applications (RIA) There is a service.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Next Generation for Desktop Applications Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
A Jumpstart to WPF by Kevin Grossnicklaus ArchitectNow.
Windows Presentation Foundation. Goal The goal of Windows Presentation Foundation (WPF) is to provide these advances for Windows. Included in version.
Rudi Grobler Session Code: WUX205.
Silverlight Technology. Table of Contents 1.What is Silverlight Technology? 2.Silverlight Overview. 2.1 How it works 2.2 Silverlight development tools.
 Saundra Speed  Mariela Esparza  Kevin Escalante.
Microsoft Programming Technologies By George SquillaceGeorge Squillace New Horizons of Michigan MCT, MCSE, MCDBA, CompTIA A+, CompTIA Network+ MCITP –
Object Oriented Software Development 9. Creating Graphical User Interfaces.
The Microsoft Technical Roadshow 2007 Rich Client Development in XAML Mark Johnston Developer & Platform Group Microsoft Ltd
CIS 451: ASP.NET Concepts Dr. Ralph D. Westfall January, 2009.
Ms. Expression Blend Intro Diliara Nasirova. WPF  UI Framework for developing and running.NET programs  It consists of two elements:  A set of DLLs.
Using Xcode A Beginner’s Tutorial Erin Green. This tutorial will walk you through Xcode, a software development tool for Apple’s iOS applications – We.
FIRST FLOOR SOFTWARE Experts in XAML. Visual Studio Industry Partner FIRST FLOOR SOFTWARE NEXT STEPS Contact us at: First.
C OMPUTING E SSENTIALS Timothy J. O’Leary Linda I. O’Leary Presentations by: Fred Bounds.
Contents : What is Silverlight? Silverlight Overview Silverlight Toolkit Overview Timeline & Packaging Silverlight V1.0 & V1.1 Properties of V1.0 Properties.
Modern Design Principles (MS). Hubs & spoke navigation pattern Hierarchical pattern Best for large collections of related content Content is separated.
RIA to visualize the health of a project Team #4 Midterm presentation February 28,2008.
Identify Windows Application Types Windows Development Fundamentals LESSON 1.1.
Windows Presentation Foundation. User Experience: Recent Past Web HTML Sacrificed UX for portability, connectivity and simplicity 1997 – DHTML.
Understanding Web-Based Digital Media Production Methods, Software, and Hardware Objective
A Detailed Introduction To Visual Studio.NET CRB Tech ReviewsCRB Tech Reviews introduces you to the world of Visual.
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
Introduction to Silverlight Development Pavel Yosifovich CTO, Matrix Global; Senior Instructor, Hi-Tech College
Introduction ITEC 420.
Introduction to .NET Framework Ch2 – Deitel’s Book
WPF vs Silverlight.
Introduction to Silverlight
WPF AKEEL AHMED.
VISUAL BASIC.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Web Development Using ASP .NET
Silverlight Technology
תכנות אסינכרוני, תקשורת ופיתוח אפליקציות ל-Windows 8
Silverlight 2 Mike Taulty Developer & Platform Group Microsoft Ltd
Emerging Platform#3 Android & Programming an App
Dot Net Application PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
Windows Presentation Foundation
Presentation transcript:

Dependency and its role in modern programming languages Antony Harfield 8 th January 2010

Background Warwick, UK: Empirical Modelling Research Group Joensuu, Finland: EdTech Research Group

Current work France: international project to develop fusion as a renewable energy source

A bit of history A long time ago, before Java and.NET existed… People have been using dependency in software Computer scientists at Warwick developed principles for using dependency and tools for building software that use dependency

What is dependency? Values (e.g. a total) dependent on other values

What is dependency? Another example of values dependent on other values from relational databases Customer CustomerId, Name Order OrderId, CustomerId, Amount ValuableCustomers Name, TotalSpent CREATE VIEW ValuableCustomers AS SELECT Name, Sum(Amount) TotalSpent FROM Customer INNER JOIN Order ON Customer.CustomerId = Order.CustomerId WHERE Sum(Amount) > 1000 GROUP BY Name

What is dependency? Properties (e.g. cell colour) dependent on values

What is dependency? Properties dependent on other properties? – A bit more difficult – Requires a notion of dependency at a low level in the application/programming language But, it gives the freedom to create dependencies between any objects, properties, and variables

Key ingredients of dependency 1.Observable (Variable, property or object) 2.Definition (Formula or function) For example, in a spreadsheet: – The observable is the cell or the value displayed in a cell – The definition is the formula of the cell (e.g. the sum of a column of cells)

Empirical Modelling Tools EDEN – a general purpose modelling environment in which any variable/property can depend on other variables/properties Web EDEN – a web-based version of EDEN currently in development DOSTE – another general purpose dependency environment ADM – a tool for defining agents with dependency JAM – a tool for adding dependency to Java Dependency is the key principle behind all these tools!

EDEN example myexample = window { title = "Listbox Example: " // mylistbox_selecteditems[1]; content = [mylistbox] };}; mylistbox = listbox { selectmode = "browse"; items = [ "blue", "red", "green", "yellow" ]; selecteditems = [ "red" ]; background = mylistbox_selecteditems[1]; font = "Verdana 32"; width = myexample_width; height = mylistbox_items# };}; Spot the dependencies

The rise of WPF Windows Presentation Foundation is Microsoft’s latest API for creating Windows applications Much richer interfaces than existing Windows Forms UIs Because it uses DirectX WPF 3.5 (in.NET Framework 3.5) is considered mature – reasonable VisualStudio integration

What can you do with WPF? Groovy user interfaces! – The usual GUI components – Rich drawing model for 2D and 3D – Animation, audio, video – Styles, templating, layouts In a variety of formats: – Traditional windows application – Packaged web app – Silverlight RIAs (Rich Internet Applications)

How do you write WPF applications? User interfaces can be written in XML, using a language called XAML Code behind in any of the CLR languages (C#, VB.NET, etc) Or you could write it all in code – but XAML is much cleaner and allows you to separate your presentation logic from your business logic

WPF Example <Window x:Class="CoolShapedWindow.Mickey" xmlns=" xmlns:x=" Title=“Mickey" AllowsTransparency="True" WindowStyle="None" Background="Transparent">

EM technologies and WPF What is the connection between WPF and Empirical Modelling? Dependency! Or more precisely, Microsoft’s implementation of.NET dependency properties

Normal properties In OOP, classes usually have fields and methods But in.NET classes also have ‘properties’ that wrap getters and setters: private String name; public String Name { get { return name; } set { name = Value; } }

Dependency properties Look like normal properties, but… Support change notification -> dependency – Bind one property to another – Triggered actions Default value inheritance Efficient storage

Dependency properties Most properties in WPF are dependency properties Therefore you can create dependencies between almost every aspect of your GUI You can create dependency properties in your custom classes so that you can make your GUI ‘depend’ upon your business objects

Binding A ‘binding’ is what creates the actual dependency For example: <TextBlock Name=“TargetTextBlock“ Text=“Sawasdee Naresuan!“ FontSize="{Binding ElementName=SourceSlider, Path=Value}"/>

Binding Equivalent binding in code: Binding binding = new Binding(); binding.Source = SourceSlider; binding.Path = new PropertyPath(“Value”); binding.Mode = BindingMode.OneWay; TargetTextBlock.SetBinding(FontSize, binding); Binding is nothing new: it has been used to bind domain objects to user interfaces for some time But (I think) WPF has brought out (or will bring out) the power of binding…

Examples Simple dependency Two way dependency Triggers Animation

Examples <Window … Title="{Binding ElementName=MyTextBox, Path=Text}"> …

Examples (two-way binding) Set Slider Value Set TextBlock FontSize

Examples (triggers)

Examples (animation) Button 1

EM / WPF comparisons 1.Types of dependency – WPF has 4 types of binding: One time One way Two way One way to source – nasty – EM has one type of dependency E.g. a = b + c

EM / WPF comparisons 2. Complexity of definitions – WPF makes it easier to do one-to-one bindings, but ‘multi-bindings’ require a bit code If you want to do a = f(x,y,z) then you need to write an IMultiValueConverter class for your function f – EM languages allow functional definitions for dependencies Simply create a definition a = f(x,y,z)

EM / WPF comparisons 3. Triggered actions – Enable you to write (ADM-like) definitions such as ‘when this condition occurs, make this state change’ – WPF has good support (see button hover example) – Triggers are fundamental concepts in EM

EM / WPF comparisons 4. User interface layout – WPF is really the first technology that encourages laying out your user interface with dependency Make the size and position of your components dependent on each other – EM has been doing this for a while, but the graphics were quite primitive Visual effects in WPF are impressive (full power of DirectX)

EM / WPF comparisons 5. Transformations – WPF has some support E.g. ‘VisualBrush’ that uses dependency/binding to paint components that are transformed – In DoNaLD (Definitive Notation for Line Drawing), there are transformations that fully use the power of dependency

EM / WPF comparisons 6. Animations – Very similar ways of doing animation Create an iterator Make positions, sizes, colours, styles dependent on the iterator (or some other component that is dependent on the iterator)

EM / WPF comparisons 7. Interactivity – The biggest area of difference! – WPF is compiled from XAML/C# The dependencies are fixed – EM technologies are interactive environments Dependencies can be changed on-the-fly

EM / WPF summary WPF has excellent graphical capabilities WPF’s dependency properties allow developers to build software artefacts that are more concise BUT… The complexity of the definitions and types of dependency could be much better It is never going to be an interactive environment

Flex has dependency too But they are not called ‘dependency properties’…

Animation through dependency (Flex) [Bindable] public var counter:int = 0; public function init() { setInterval(function(){ counter++; }, 1000); } <mx:Text text="Hello" x="{counter}" scaleY="{counter/10}“ color="{counter*1024}" />

Running the examples To run the WPF examples you will need Visual Studio 2008 – Create new project -> WPF Application To run the Flex examples you can download a trial version of Flex Builder from Adobe

More information Empirical Modelling: WPF: pick up a book, or Google for “wpf dependency properties” Flex: go to the Adobe Developer Connection ( or Flex After Dark (

Thank you for your patience Antony Harfield Questions?