Architecture design. Use of some Microsoft patterns & practices for Architecture Guidance (http://www.microsoft.com/practices)



Similar documents
Real-World ASP.NET: Building a Content Management System

ASP and ADO (assumes knowledge of ADO)

Database Communica/on in Visual Studio/C# using Web Services. Hans- Pe=er Halvorsen, M.Sc.

SQL injection attacks SQL injection user input SQL injection SQL Command parameters Database account. SQL injection attacks Data Code

Security API Cookbook

Conexión SQL Server C#

Durée 4 jours. Pré-requis

Creating Form Rendering ASP.NET Applications

A PROJECT REPORT ON. SkyDrive. Submitted for the partial fulfillment of the requirement for the Award of the degree of MASTER OF COMPUTER APPLICATION

TS: Microsoft.NET Framework 3.5, ASP.NET Application Development

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

Web Services in.net (1)

How To: Create a Crystal Report from ADO.NET Dataset using Visual Basic.NET

Aucune validation n a été faite sur l exemple.

MOVING THE SENIOR DEVELOPMENT CLASS FROM WEB DEVELOPMENT TO LIFE CYCLE DEVELOPMENT A CASE FOR VISUAL STUDIO 2005

PostGIS Integration Tips

Remote Method Invocation

Integrate 'Oracle Forms', 'Oracle Reports', 'Oracle

Administrer les solutions Citrix XenApp et XenDesktop 7.6 CXD-203

TP : Système de messagerie - Fichiers properties - PrepareStatement

Concevoir et déployer vos applications à base de microservices sur Cloud Foundry


Category: Business Process and Integration Solution for Small Business and the Enterprise

Stockage distribué sous Linux

CATALOG OF CLASSES IT and Technical Courses

Expanded contents. Section 1. Chapter 2. The essence off ASP.NET web programming. An introduction to ASP.NET web programming

Enhancing your Web Experiences with ASP.NET Ajax and IIS 7

Brazil + JDBC Juin 2001, douin@cnam.fr

CloudCERT (Testbed framework to exercise critical infrastructure protection)

B. WEB APPLICATION ARCHITECTURE MODELS

Database Communica/on in Visual Studio/C# using ASP.NET Web Forms. Hans- PeBer Halvorsen, M.Sc.

SQL EXPRESS INSTALLATION...

Framework as a master tool in modern web development

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

SOFTWARE DEFINED SOLUTIONS JEUDI 19 NOVEMBRE Nicolas EHRMAN Sr Presales SDS

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

HOSPITAL MANAGEMENT SYSTEM

Ambientes de Desenvolvimento Avançados

CASifier une application

ASP.NET Forms Authentication Best Practices for Software Developers

Les fragments. Programmation Mobile Android Master CCI. Une application avec deux fragments. Premier layout : le formulaire

Implementing Mobile Thin client Architecture For Enterprise Application

Developing ASP.NET MVC 4 Web Applications MOC 20486

JANVIER 2013 / CATALOGUE DES FORMATIONS

Technical Service Bulletin

Rev 7 06-OCT Site Manager Installation Guide

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Thursday, February 7, DOM via PHP

Pro<DOC/> e-commerce Technology An Introduction

TP : Configuration de routeurs CISCO

Stock Trader System. Architecture Description

Secure Testing Service

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Web Services. with Examples. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Langages Orientés Objet Java

SharePoint 2010 Interview Questions-Architect

Enterprise Risk Management & Board members. GUBERNA Alumni Event June 19 th 2014 Prepared by Gaëtan LEFEVRE

How To Create A Database In Araba

PROCEDURE INSERTION(NUM IN EMPLOYES.NUMEMP%TYPE, NOM VARCHAR2, PRENOM IN VARCHAR2, PPHOTO IN BLOB, SALAIRE IN NUMBER);

SaaS-Based Employee Benefits Enrollment System

multiple placeholders bound to one definition, 158 page approval not match author/editor rights, 157 problems with, 156 troubleshooting,

İNTERNET TABANLI PROGRAMLAMA- 13.ders GRIDVIEW, DETAILSVIEW, ACCESSDATASOURCE NESNELERİ İLE BİLGİ GÖRÜNTÜLEME

This three-day instructor-led course provides students with the tools to extend Microsoft Dynamics CRM 4.0.

Developing Microsoft SharePoint Server 2013 Advanced Solutions. Version: Demo. Page <<1/8>>

Sense/Net ECM Evaluation Guide. How to build a products listing site from the scratch?

Cloud-based Data Logging, Monitoring and Analysis

ICS 434 Advanced Database Systems

RETURN RESPONSES TO: RETOURNER LES ANSWERS À :

Custom Error Pages in ASP.NET Prabhu Sunderaraman

C# Datenbank-Programmierung

Modern Web Application Framework Python, SQL Alchemy, Jinja2 & Flask

Junos Space for Android: Manage Your Network on the Go

ASP.NET Using C# (VS2012)

Configuration Guide. SafeNet Authentication Service. SAS Agent for AD FS

Qualifying Microsoft Training for Software Assurance Training Vouchers (SATVs)

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology Fall 2007

Sun Management Center Change Manager Release Notes

Base One's Rich Client Architecture

Il est repris ci-dessous sans aucune complétude - quelques éléments de cet article, dont il est fait des citations (texte entre guillemets).

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

NSD1168 How to Install One Time Password Server Prefetch ASP.NET Web Application on IIS 6

MS SQL Installation Guide

Developing ASP.NET MVC 4 Web Applications

ADOBE READER AND ACROBAT

Configuration Backup and Restore. Dgw v2.0 May 14,

CompatibleOne & le SLA

Audit de sécurité avec Backtrack 5

CFT ICT review Questions/Answers

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty("java.security.policy","../server.java.

Design and Functional Specification

You need to recommend a monitoring solution to ensure that an administrator can review the availability information of Service1. What should you do?

Transcription:

1

Architecture design Use of some Microsoft patterns & practices for Architecture Guidance (http://www.microsoft.com/practices) 2

Page asp.net simple <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <html> <head> <title>start</title> <script language="c#" runat=" ="server"> void Page_Load(object object sender, System.EventArgs e) { String selectcmd = "select * from Recording"; SqlConnection myconnection = new SqlConnection( "server=(local); =(local);database=recordings;trusted_connection =yes"); SqlDataAdapter mycommand = new SqlDataAdapter(selectCmd selectcmd, myconnection); DataSet ds = new DataSet(); mycommand.fill(ds ds,, "Recording" Recording"); recordingselect.datasource = ds; recordingselect.datatextfield = "title" title"; recordingselect.datavaluefield = "id"; recordingselect.databind(); } void SubmitBtn_Click(Object sender, EventArgs e) { String selectcmd = String.Format( "select * from Track where recordingid = {0} order by id", (string)recordingselect.selecteditem.value recordingselect.selecteditem.value); SqlConnection myconnection = new SqlConnection( "server=(local); =(local);database=recordings;trusted_connection Trusted_Connection=yes") ; SqlDataAdapter mycommand = new SqlDataAdapter(selectCmd selectcmd, myconnection); DataSet ds = new DataSet(); mycommand.fill(ds ds,, "Track" Track"); MyDataGrid.DataSource = ds; MyDataGrid.DataBind(); } </script> </head> <body> <form id="start" method="post" runat="server"> <h3>recordings</h3> Select a Recording:<br /> <asp:dropdownlist id="recordingselect" runat="server" /> <asp:button runat="server" text="submit" OnClick="SubmitBtn_Click" /> <p/> <asp:datagrid id="mydatagrid" runat="server" width="700" backcolor="#ccccff" bordercolor="black" showfooter="false" cellpadding="3" cellspacing="0" font-name="verdana" font-size="8pt" headerstyle-backcolor="#aaaadd" enableviewstate="false" /> </form> </body> </html> 3

Model-View View-Controller (MVC) modifie Contrôleur (gère les actions de l utilisateur : inputs Modèle génère (gère les données) Vue Demande infos (affichage des informations) 4

The View (page aspx) <%@ Page language="c#" Codebehind=" ="Solution.aspx.cs" AutoEventWireup=" ="false" Inherits="Solution" %> <html> <head> <title>solution</title> </head> <body> <form id="solution" method="post" runat="server"> <h3>recordings</h3> Select a Recording:<br/> <asp:dropdownlist id="recordingselect" runat="server" /> <asp:button id="submit" runat="server" text="submit" enableviewstate="false" /> <p/> <asp:datagrid id="mydatagrid" runat="server" width="700" backcolor="#ccccff" bordercolor="black" showfooter="false" cellpadding="3" cellspacing="0" font-name="verdana" font-size="8pt" headerstyle-backcolor="#aaaadd" enableviewstate="false" /> </form> </body> </html> 5

Le modèle using System; using System.Collections; using System.Data; using System.Data.SqlClient; public class DatabaseGateway { public static DataSet GetRecordings() { String selectcmd = "select * from Recording"; public static DataSet GetTracks(string recordingid) { String selectcmd = String.Format( "select * from Track where recordingid = {0} order by id", recordingid); SqlConnection myconnection = new SqlConnection( } SqlConnection myconnection = new SqlConnection( "server=(local);database=recordings;tru sted_connection=yes"); SqlDataAdapter mycommand = new SqlDataAdapter(selectCmd, myconnection); DataSet ds = new DataSet(); mycommand.fill(ds, "Recording"); return ds; } "server=(local);database=recordings;tru sted_connection=yes"); SqlDataAdapter mycommand = new SqlDataAdapter(selectCmd, myconnection); DataSet ds = new DataSet(); mycommand.fill(ds, "Track"); return ds; 6

Le contrôle (code behind) using System; using System.Data; using System.Collections; using System.Web.UI.WebControls; public class Solution : System.Web.UI.Page { protected System.Web.UI.WebControls.Button submit; protected System.Web.UI.WebControls.DataGrid MyDataGrid; protected System.Web.UI.WebControls.DropDownList recordingselect; private void Page_Load(object sender, System.EventArgs e) { if(!ispostback) { DataSet ds = DatabaseGateway.GetRecordings(); recordingselect.datasource = ds; recordingselect.datatextfield = "title"; recordingselect.datavaluefield = "id"; recordingselect.databind(); } } void SubmitBtn_Click(Object sender, EventArgs e) { DataSet ds = DatabaseGateway.GetTracks( (string)recordingselect.selecteditem.value); #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.oninit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.submit.click += new System.EventHandler(this.SubmitBtn_Click); this.load += new System.EventHandler(this.Page_Load); } #endregion } MyDataGrid.DataSource = ds; MyDataGrid.DataBind(); } 7

Page controller pattern 8

Page controller pattern ( presentation : extension of MVC pattern ) Page controller pattern http://msdn.microsoft.com/practices/type/patterns/enterprise/imppagecontroller/ 9

Architecture design Layered Architecture Users Presentation Business Business Workflows Service Interfaces Business Components Business Entities User interfaces decoupled from business logic Ability to add new functionalities/technologies Access Data Access Logic Components Service Agents Data Sources Services 10

Du rôle des objets Stockage (arrière boutique) cuisine façade Extérieur fast food salade 0 3 carottes frigo Ouvre le frigo Va me chercher les ingrédients chef Ils veulent une salade serveur On voudrait une salade clients commis Ouvre le placard, s huile sel placard 11

Du rôle des objets Stockage (arrière boutique) cuisine façade Extérieur fast food salade 0 3 carottes frigo voilà ingrédients préparés 30 chef Voila la recette préparée serveur Je vous présente le plat clients, huile commis Je prépare les ingrédients,s plat Je prépare le plat 00 33saladier Je présente le plat 33 00 s s sel placard 12

0 3 Stockage (arrière boutique) salade carottes frigo Du rôle des objets 30 cuisine Objets métiers (traitement des données) chef façade serveur Extérieur fast food clients Données, huile stockage commis,s 00 0 plat 33saladier 33 s s sel placard Objets de données (entity objects, data object, data transfer objects ) 13

Façade ade Pattern Façade ade 14

Architecture n tiers UI/WS Biz Facade Biz Rules Data Access Data Sources Simulation pages WEB MCE PC PDA Smartphone Objets métiers WS WS (appliances) Cas d utilisations provider Boiler Thermostat Programm User connexion aux sources de données XML Conf Data RegisterAppliance Evts boiler breakdown temp changed Représentation des données communes : biz entities 15

Architecture n tiers MCE MCE PC Data Sources Data Access Biz Rules Biz Facade UI / WS PPC IIS +.netfw Simulation UI : WS WEB/Exe Biz Facade (use cases) 16

Architecture design : ed architecture W3Home application server Business Logic Presentation Biz Facade Biz Rules Data Access Data Sources/ services User Serveur Pages WEB Services Use Cases Business components Business components Data Access components Data Access components WS XML Conf Data Code to physically access Data, equipments & services 17

Architecture design : example Presentation applicative logic - specific protocols decouplement Biz Facade Biz Rules Data Access Boiler Simulation SetBoilerState.aspx SetBoilerState Boiler DaBoiler Calendar Simulation User IComeBack.aspx UserComeBack ComfortSystem Zones Thermostat Da Thermostat Standalone application WEB Interface to simulated Objects : = application component Check equipments states Raise events 18

Architecture design : example Loosely coupled component functionalities augmentation Presentation Biz Facade Biz Rules Data Access SetBoilerState.aspx SetBoilerState Boiler DaBoiler Boiler Simulation Calendar User SetBoilerState.aspx UserComeBack ComfortSystem Zones Thermostat Da Thermostat Video surveillance system WEBCam DA WEBCam = application component 19

Architecture design : example Equipments integration via standard protocols Presentation Biz Facade Biz Rules Data Access User User DA System Notification RegisterBoilerError.asmx Register Boiler Error System Notification Boiler DaBoiler Boiler Simulation Boiler Service Provider Boiler Service Provider SOAP = application component Content/services Providers Ex : customer service application 20

WEB Facade Relations entre les Couches BizFacade BizRules Interfaces WEB Point d entrée public aux : (pour le User) EntertainmentSystem ThermalComfortSystem SecuritySystem (pour les Devices) ControlPointSystem Règles métier pour gérer : Boiler thermostat camera MediaCenter NotificationSystem Devices ControlPoint ServiceProvider Zones Zone DataSources Data Access Fichiers XML Simulation Services WEB Accès bas niveau Common Types de données commun : liste programmes, messages d événements,conf etc. Services Distants Devices, Services clients 21

(long terme) exemple d alternative d possible BizFacade Point d entrée public aux : (pour le User) EntertainmentSystem ThermalComfortSystem SecuritySystem (pour les Devices) ControlPointSystem BizRules Règles métier pour gérer : Boiler thermostat camera MediaCenter NotificationSystem Devices ControlPoint ServiceProvider Zones Zone DataSources Data Access Fichiers XML Simulation Socket Serveur Accès bas niveau Common Types de données commun : liste programmes, messages d événements,conf etc. 22

MySchool S identifier User Voir la liste des étudiants <<étend>> Voir les informations d un étudiant 23

Architecture design : example Presentation Biz Facade Biz Rules Data Access Login.aspx AccountingSystem DataFees Simulé ViewStudentList.aspx StudentsSystem User DAUser Browser ViewStudent.aspx MySchoolAP.asmx app = application component 24

Les classes 25

Les classes 26

Projet serveur Projet client 27

KO CheckLogin(log,pwd) OK GetStudentList() Mise en session De la valeur Id «UserId» Session Page suivante GetStudent (int) 28

29

football247.net In the pack you receive at the end of the day Post-event CD http://www.football247.net Football247.Net Workspace on http://www.gotdotnet.com http://www.rational.com/uml/ Building Secure ASP.NET Solutions http://www.microsoft.com/downloads/release.asp?rel easeid=44047 30

Football247.net use case diagram Browse Football Data Shopping Browser Buy Authentication User Maintenace Reporter Game Reporting Import Football Data Game Maintenance Administ rator 31

Football247.net Football247.Common Application Architecture.Core.Datasets Solution Structure System Architecture Football247.Presentation Firewall User Tier.Administrator,.Reporter.WinControls.WebSite.WebControls.Facades Football247.Business Business Tier.Facades.Services.Host Firewall Data Tier Football247.Data.DataAccess SQL 32

Do you Web Forms or Windows Forms you want thin, thick,, fat, rich, dumb,, smart, Windows or Internet? User Experience Deployment Updating Security Mobile Web Forms Relatively hard to make web pages dynamic with DHTML. Easy. Only on server. Reach Shadow copying prevents restarts of the web application Authorized actions depend on zone. Microsoft Mobile Internet Toolkit Windows Forms Dynamic, responsive UI. End users love it. Can be deployed through web server..net Framework required on client. Can Rich update on web server. Authorized actions depend on zone. Code Access Security..NET Compact Framework 33

34 Presentation Presentation Data Data Football247.net Football247.net clients clients WS Façade (asmx) WS Façade (asmx) ASP.NET UI (aspx) ASP.NET UI (aspx) WIN Service WIN Service Business Business WS Façade WS Façade ES Façade ES Façade Biz Services Biz Services D A L D A L S P S P or browser admin reporter

35