Dependency in action A look at how dependency is used in modern programming languages Antony Harfield 22 nd October 2009.

Slides:



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

Programming Paradigms and languages
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
Dinko Jakovljević Microsoft Student Partner | BambooLab
An Introduction To Silverlight Gergely Orosz
Windows Presetation Foundation (WPF) 1. Introduction.
OPC WPFHMI.NET.
The Microsoft’s solution for building cross-platform Rich Internet Applications.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Ronnie Saurenmann Principal Architect Microsoft Switzerland
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Michael S. Scherotter Microsoft Corporation
Best and Worst Practices Building RIA from Adobe and Microsoft.
Aptech Borivali(West) Hefin Dsouza. Agenda  What is.NET and What is Visual Studio? .NET Framework 3.5 Overview.  Visual Studio 2008 Enhancements. 
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Windows “Longhorn” future version of Windows OS Jan “Honza” Stoklasa janstok at microsoft dot com janstok at microsoft dot com Academic Program.
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.
CS360/CS580H GUI & Windows Programming. Outline Win32/Windows API & SDK Visual Studio MFC – Microsoft Foundation Classes C# &.NET – concepts Windows Forms.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
1 COS240 O-O Languages AUBG, COS dept Lecture 33 Building Apps Technologies C# (WPF part 1)
Introduction to Mobile Programming. Slide 2 Overview Fundamentally, it all works the same way You get the SDK for the device (Droid, Windows, Apple) You.
Next Generation for Desktop Applications Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
A Jumpstart to WPF by Kevin Grossnicklaus ArchitectNow.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
Windows Presentation Foundation. Goal The goal of Windows Presentation Foundation (WPF) is to provide these advances for Windows. Included in version.
CS360/CS580H GUI & Windows Programming Introduction.
Windows Presentation Foundation Adam Calderon Principal Engineer Interknowlogy LLC
Silverlight Technology. Table of Contents 1.What is Silverlight Technology? 2.Silverlight Overview. 2.1 How it works 2.2 Silverlight development tools.
Building RIA for Desktop, Web and Mobile using Silverlight and WPF Giorgio Sardo UX Consultant, Microsoft UK blogs.msdn.com/Giorgio.
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
Discover, Master, Influence1 Windows Presentation Foundation David Burela Senior Developer, Readify.
Developing ASP.NET AJAX Controls with Silverlight Barry Gervin Microsoft Regional Director John Bristowe Developer Advisor, Microsoft.
A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software? It’s Difficult! Animation 2D 3D Documents Styled Controls Video Windows.
WPF – Windows Presentation Foundation what is it, what can you do with it and how do you get started.
13. JavaFX. 2 JavaFX Intro Sun's answer to –the popularity of scripting languages –problems with Java GUI AWT is very basic Swing is too complex, too.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Introduction to Flex 2 by Rich Tretola. About Me Rich Tretola is a senior software developer at Herff Jones, Inc. specializing in Rich Internet Applications.
Contents : What is Silverlight? Silverlight Overview Silverlight Toolkit Overview Timeline & Packaging Silverlight V1.0 & V1.1 Properties of V1.0 Properties.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
1 Välkommen till Sommarkollo Windows Presentation Foundation Per Östman ISV Developer Evangelist
Eben de Wit Developer Advisor Microsoft
Identify Windows Application Types Windows Development Fundamentals LESSON 1.1.
Soyatec Contents Needs Architecture XAML fundamentals Data Binding Advanced features Style Q&A.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Building Windows Phone 7 Games and Applications Yes, yes! “Games and Applications” and not “Applications and Games” Content is under NDA – please do no.
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
Introducing the Microsoft® .NET Framework
DotNetSpider Editor Hefin Dsouza
Introduction to .NET Framework Ch2 – Deitel’s Book
WPF vs Silverlight.
Introduction to Silverlight
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Web Development Using ASP .NET
Silverlight Technology
תכנות אסינכרוני, תקשורת ופיתוח אפליקציות ל-Windows 8
.NET and .NET Core 8. WPF Hierarchy Pan Wuming 2017.
Dot Net Application PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
Windows Presentation Foundation
Windows Forms in Visual Studio 2005: An in-depth look at key features
Presentation transcript:

Dependency in action A look at how dependency is used in modern programming languages Antony Harfield 22 nd October 2009

My current work

A bit of history A long time ago, before.NET existed…

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 EDEN/DOSTE/ADM? 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="Hello Warwick!“ 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 – Unable 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 a little bit more like Empirical Modellers 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 not 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 Google: “wpf dependency properties” or “wpf binding” or “flex binding” WPF – pick up a book Adobe Developer Connection: Flex After Dark:

Questions