Presentation is loading. Please wait.

Presentation is loading. Please wait.

Architecture and Design Pattern in Applications Development On.NET Platform Sergey Baidachni MCT, MCSD, MCDBA.

Similar presentations


Presentation on theme: "Architecture and Design Pattern in Applications Development On.NET Platform Sergey Baidachni MCT, MCSD, MCDBA."— Presentation transcript:

1 Architecture and Design Pattern in Applications Development On.NET Platform Sergey Baidachni MCT, MCSD, MCDBA

2 Overview Introduction to the automobile design.NET Framework architecture OOP in.NET Framework (C#) Design Patterns

3 Introduction About Cars  A little about cars  How cars are designed, or game of Puzzles Car creation and program creation When should we talk about.NET? Requirements or how to please a car amateur

4 When should you talk about.NET Should you start out with coding? Ford and model Т Collection of requirements MSF – Microsoft Solution Framework

5 Requirements Business  Interaction between goals and objectives, products and services, financial structures and major organizational structures Application  Automated and Non automated services that support the business process Operation  What the organization needs to know to run its business process Technology  Technical service needed to perform and support the business mission

6 MSF

7 .NET Framework architecture What does it look like? What language should you choose? Common Language Runtime Developing interactions with data bases Windows application– what can be any simpler? ASP.NET – development of Web applications Web Services or will there be any future Web applications?

8 Как это выглядит? Win32 MessageQueuingCOM+ (Transactions, Partitions, Object Pooling) IISWMI Common Language Runtime.NET Framework Class Library ADO.NET: Data and XML XML Web Services User Interface Visual Basic C++C# ASP.NET PerlJ#…

9 What language to choose? С# - New component-oriented language for.NET VB.NET – New language version VB with additions Managed Extensions to С++ J# - for Java amateurs …And any languages

10 What language to choose? Microsoft Intermediate Language (MSIL) Or Common Intermediate Language

11 Common Language Runtime Base Class Library Support Thread Support COM Marshaler Type Checker Exception Manager MSIL to Native CompilersCodeManagerGarbageCollector Security Engine Debug Engine Class Loader

12 Data Base interaction ADO.NET Connected environment Disconnected environment System.Data: DataSet, DataTable, DataRow,DataColumn.NET Providers: System.Data.SqlClient, System.Data.Odbc, System.Data.OleDb, System.Data.OracleClient

13 Data Base Interaction ADO Connection Command RecordSet ADO.NET XxxConnection XxxTransaction XxxCommand XxxDataReader XxxDataAdapter DataSet.NET Data Provider

14 Windows application Convenient graphic designer for Visual Studio.NET System.Windows.Forms  Controls  Form, TextBox, ComboBox e. t. c. System.Drawing  Drawing  Pens, Brushes e. t. c.

15 Windows applications It is an extremely short program using System.Windows.Forms; class SimpleForm { static void Main() { Form form=new Form(); Application.Run(form); }

16 ASP.NET – Development of Web applications Web Forms editor for VS.NET System.Web  User interface  Security  SessionState  Caching  Configuration

17 XML Web Services What is this?  URL-addressable set of functionality exposed over a network Advantage  HTTP: Stateless and text  XML: Standard format  Any platform and language Standards  XML  SOAP  WSDL  XSD

18 OOP in.NET Framework (C#) Class and Object What’s missing? Class in C# Using UML Basics on OOP

19 Class and Object Class  Abstract notion  Description of something  A named syntactic construct that describes common behavior and attributes Object  Instance of a class  Identity  Behavior  State

20 What’s missing? OOP – way of thinking of a human Can I set gears in motion? Access Modifiers  public  private  protected …And additional in.NET  internal  protected internal

21 Class in C# public class Bicycle { public Wheel leftWheel; public Wheel rightWheel; public void move the pedals (){…} protected void move the gear (){…}..... }

22 Using UML Which language is of easy understanding to all? UML – Universal modulation language

23 Basics on OOP Encapsulation  Combining Data and Methods  Controlling access visibility Polymorphism Inheritance Abstract base class Interfaces

24 Inheritance  Specifies an “is a kind of” relationship  Class relationship  Specialize existing classes

25 Inheritance example (C#) public class Bicycle { public Wheel leftWheel; public Wheel rightWheel; public void Move the pedals (){…} protected void Move the gear (){…}..... } public class ExtendBicycle: Bicycle { protected void Move the gear (){…}..... }

26 Polymorphism The method name resides in the base class The method implementations reside in the derived classes String Musician TuneYourInstrument( ) Guitar Player TuneYourInstrument( ) Violin Player TuneYourInstrument( ) A method with no implementation is called an operation A method with no implementation is called an operation

27 Polymorphism example(C#) public class StringMusician { public virtual void Tune(){…} } public class GuitarPlayer: StringMusician { public override void Tune(){…} } public class ViolinPlayer: StringMusician { public override void Tune(){…} } StringMusician obj=new ViolinPlayer(); obj.Tune();

28 Abstract Base Classes Some classes exist solely to be derived from  It makes no sense to create instances of these classes  These classes are abstract Stringed Musician { abstract } Stringed Musician { abstract } Guitar Player « concrete » Guitar Player « concrete » Violin Player « concrete » Violin Player « concrete » You can create instances of concrete classes You can create instances of concrete classes You cannot create instances of abstract classes

29 Abstract base class example(C#) public abstract class StringMusician { public abstract void Tune(); } public class GuitarPlayer: StringMusician { public override void Tune(){…} } public class ViolinPlayer: StringMusician { public override void Tune(){…} } StringMusician obj=new ViolinPlayer(); obj.Tune();

30 Interfaces Contains only operations without implementation

31 Interfaces example(C#) public interface StringMusician { void Tune(); } public class GuitarPlayer: StringMusician { public void Tune(){…} } public class ViolinPlayer: StringMusician { public void Tune(){…} } StringMusician obj=new ViolinPlayer(); obj.Tune();

32 Design Patterns What is this? Strategy Pattern Singleton Pattern Publish-Subscribe Pattern

33 What is this? Solution of the problem that occurs most often Patterns Name  Strategy  Proxy  Iterator Problem definition Solving Results

34 Strategy pattern Problem Solving (UML) Solving (C#)

35 Problem Do I need all the algorithms? How do I choose the proper method? swith(type) { case 1: FirstMethod(); case 2: SecondMethod();..... }

36 Solving (UML)

37 Solving (C#) interface AbstractStrategy { void Operation(); } class ConcreteStrategy1: AbstractStrategy { public void Operation(){... } } class ConcreteStrategy2: AbstractStrategy { public void Operation(){... } } public class Client { private AbstractStrategy stat; }

38 Singleton Pattern Problem Solving (UML) Solving (C#)

39 Problem Only one class sample What for?  One Garbage Collector  One Explorer

40 Solving (UML)

41 Solving (C#) class Singleton { public static Singleton Instance() { if (_instance == null) { _instance = new Singleton(); } return _instance; } protected Singleton(){}; private static Singleton _instance; }

42 Publish-Subscribe Problem Solving (UML) Solving (C#)

43 Problem How Windows work Message Queue Repainting windows

44 Solving (UML)

45 Solving (C#) Event and Delegate Example


Download ppt "Architecture and Design Pattern in Applications Development On.NET Platform Sergey Baidachni MCT, MCSD, MCDBA."

Similar presentations


Ads by Google