Nuno Godinho

Post on 06-May-2015

608 views 4 download

Tags:

description

apresentação do Nuno Godinho no evento RIAPT de dia 16 de Janeiro.

Transcript of Nuno Godinho

Developing Line-of-Business Applications with Microsoft Silverlight

Nuno GodinhoNuno.Godinho@sapo.pt

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

About Me

Nuno Filipe Godinho

Independent Consultant

Mail: Nuno.Godinho@sapo.pt

Nuno.Godinho@itech4all.com

Blogs: http://pontonetpt.com/blogs/nunogodinho

http://xamlpt.com/blogs/nunogodinho

http://weblogs.asp.net/nunogodinho

http://msmvps.org/blogs/nunogodinho

Twitter: @NunoGodinho

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

IntroductionProblem Statement

Problems◦ N-Tier

◦ Controls

◦ Rich Text Support

◦ Multi-language Support

◦ Customer Devices Interaction

◦ Communications

◦ Extensibility

◦ Offline Support

◦ Interoperability

IntroductionChallenges using N-Tier applications

LoB applications use data that needs to flow across tiers

Created and used through basic CRUD operations

In an internet application, there is a trust boundary between the client and the mid-tier server

Important to have a well defined and secured resources that are available to the client tier and also what operations are permitted

IntroductionChallenges using N-Tier applications

The validation needs to run on Client and On Server as well as on Mid-Tiers

Common validation across the tiers

Services that may be shared with other applications

IntroductionVision and Goals

Simplify RIA-style application development◦ n-tier is hard, and un-natural

◦ Focus on data-driven apps

Bring ASP.NET-style productivity to RIA development◦ Building blocks for data, security, etc.

◦ Focus on scenarios

IntroductionValue Propositions

Focus on data in an end-to-end manner

A unified story for client and server development

A prescriptive framework that targets key scenarios, and leads the common developer to a pit of success

IntroductionValue Propositions

Simplify application development across tiers and trust boundary ◦ Provides a set of tools to build the multiple tiers of an application

together

◦ Application logic remains aware of tier and trust boundaries

◦ Uses the end-to-end flow of data and metadata described earlier

◦ Code generation and shared code

Enhance the experience by providing multiple choices for sharing logic while respecting tier and trust boundaries

ApplicationBrowserRich Internet Application

DB

Service

Other Applications

IntroductionA Unified Story for Client and Server

Client is an extension of the server

A single logical application

Data Access

Layer

App

Logic

Services

HTMLPresentation

LogicNetwork

IntrodutionValue Propositions

Define and support a pattern for exposing a set of operations on resources

DomainService◦ Define a set of operations on resources

Framework and Tools◦ Collaborate to generate code for a corresponding client-tier

◦ Services for authentication and user settings can be used out-of-the box

IntroductionA Prescriptive Pattern

Rich Internet Application

DB

Services

Data Access

Layer

App

Logic

Presentation

LogicNetwork

Domain

Context

Domain

Service

Under the covers infrastructure

IntroductionA Single Pattern that Scales and Grows

Support for multiple presentation tiers and data access technologies

App

Logic

Databases

ADO.NET,

ORMs (LTS, EF, …)

CLR

Lists/Objects

Repository

(nHibernate, …)

Services

REST/SOAP

(Azure, …)SOAP,

XML,

JSON,

Binary

.NET Clients

Silverlight, WPF

Standards

Clients

JavaScript

Server

Rendering

HTML, SEO,

Printing, …

Services

WCF

Unit Test

Code

Line-of-Business Application

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

Recommended Pattern

Recommended PatternMVVM

Why?◦ Separation of concerns

◦ Better Workflow between Developer and Designer

◦ Easier Testability

Why not MVC?◦ We need to have access to the Code-Behind and MVC doesn’t support

that, only Code-Behind Pattern does, but doesn’t delivers easy separation of concerns

Recommended PatternMVVM

Display data in Controls

UI Friendly Entities, UI State, Actions

Entities representing data

MVVM Implementation in Silverlight

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

Interopwith other

Platforms & WS-*

ASMX & WSE

Attribute-Based

Programming

Enterprise Services

REST / HTTP Programming

HTTP Services

Message-Oriented

Programming

System.Messaging

ExtensibilityLocation

transparency

.NET Remoting

CommunicationUnified Programming Model

CommunicationsWindows Communication Foundation (WCF)

CommunicationsWCF RIA Services

Framework, tools and services with prescriptive pattern for n-tier applications

Data

Access

Layer

(DAL)

App

Logic

Database

View

Web

Service

App

Logic

Trust

Boundary

Client project

CommunicationsWCF RIA Services

Design-time view

Server project

Domain

Service

Data

Access

Layer

(DAL)

Entities

Solution (Application)

Views

Domain

Context

EntitiesBuild, reflect

& code-gen

Silverlight

CommunicationsRun-time view (entity lifecycle)

Web server

Domain

Service

Data

Access

Layer

(DAL)

Application

ViewsDomain

Context

LoadQuery

Entities

Results

Submit

Entities

Submit

Results

CommunicationsServices

Authentication

Roles

User profile

All integrate w/ ASP.NET infrastructure

WCF RIA Services

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

Beyond the Browser

Out-of-Browser Applications

Trusted Applications

Beyond the BrowserOut-of-Browser – Already on Silverlight 3

Configuration Based

AppManifest.xml

Can be enabled in an existing application without rebuilding

Install option on its right-click menu

Can run without a network connection

You can implement network detection and provide offline

support when a connection is unavailable

Beyond the BrowserOut-of-Browser

Windowing API

WebBrowser control

HtmlBrush

Notification (aka. Toast)

Beyond the BrowserTrusted Applications

OOB with elevated privileges

COM Interop in Windows

File system access

Cross-domain networking access

Full keyboard support in Full-Screen Mode

Beyond the Browser

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

Extensibility

Prism v2

MEF – Managed Extensibility Framework

ExtensibilityPrism v2

Prism is a set of options

Use what you want and ignore the rest◦ Example:

Choose Modules and Commanding, but ignore Event Aggregation and Regions

ExtensibilityPrism v2

Prism Technical Concepts

ExtensibilityMEF – Managed Extensibility Framework

A new library in Silverlight 4 for building applications that can be incrementally

extended.

ExtensibilityMEF – Managed Extensibility Framework

An Application is built of parts.

ExtensibilityMEF – Managed Extensibility Framework

Export it.

Import it.

Compose it.

ExtensibilityMEF – Managed Extensibility Framework

Export it - Metadata

Widget1

[ExportMetadata(“Location”,Location.Top)][Export(typeof(UserControl))]public class Widget1 : UserControl{

public string Message {get{return(string) Button.Content;}

set{Button.Content=value;}}

}

Export

ExtensibilityMEF – Managed Extensibility Framework

Import it - Metadata

MainPage

[Export(typeof(UserControl))]public class MainPage: UserControl{

[ImportMany(typeof(UserControl))]public IEnumerable<Lazy<UserControl, IWidgetMetadata> {

get;set;}

}

ImportMany

MEF – Managed Extensibility Framework

Agenda

Introduction

Recommended Pattern

Communications

Beyond the Browser

Extensibility

Q&A

Nuno Filipe GodinhoIndependent Consultant

Mail: Nuno.Godinho@sapo.ptNuno.Godinho@itech4all.com