Linq-to-Entities, Data Persisters, Master Datail Doncho Minkov Telerik School Academy Technical Trainer

Slides:



Advertisements
Similar presentations
MVVM Overview Frank Shoemaker MindCrafted Systems
Advertisements

Database management system (DBMS)  a DBMS allows users and other software to store and retrieve data in a structured way  controls the organization,
Allocation Methods - Contiguous
Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Physical design. Stage 6 - Physical Design Retrieve the target physical environment Create physical data design Create function component implementation.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Information systems and databases Database information systems Read the textbook: Chapter 2: Information systems and databases FOR MORE INFO...
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day.
Unit J: Creating a Database Microsoft Office Illustrated Fundamentals.
READING, WRITING, BINDING, VALIDATING AND VISUALISING YOUR DATA Business value with Silverlight.
Doncho Minkov Telerik School Academy academy.telerik.com Technical Trainer
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
Target: dependency property Source: any public property CLR and WPF properties Target: dependency property Source: any public property CLR and WPF properties.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Enticy GROUP THE A Framework for Web and WinForms (Client-Server) Applications “Enterprise Software Architecture”
Last lecture data binding, binding object markup extension bind to any prop with INotifyPropertyChanged, target must be dep. prop. bind to obj... so no.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Building Data-Driven ASP.NET Web Forms Apps Telerik Software Academy ASP.NET Web Forms.
Getting Started with Caliburn.Micro and Windows Phone 7 Gary Ewan Park Twitter: Blog:
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Basic WPF Controls Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
Meeting #6 – April 2011 – Web-Technologies Homework Assignments Svetlin Nakov Telerik Corporation
| | Tel: | | Computer Training & Personal Development Microsoft Office SharePoint Designer.
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Object Oriented Software Development 10. Persistent Storage.
Svetlin Nakov Telerik Corporation
What have we learned?. What is a database? An organized collection of related data.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Module 7 Data Binding to Collections. Module Overview Binding to Collections of Objects Using Collection Views Create Master-Detail User Interfaces Using.
+ Information Systems and Databases 2.2 Organisation.
Memory Management Problem: Records (of various lengths) need to be stored. Model: A big array of space to store them, managed by a memory manager. Like.
Three Layer Architecture Why Bother with the Middle Layer?
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Building Dashboards SharePoint and Business Intelligence.
ControlTemplate and DataTemplate Doncho Minkov Telerik School Academy Technical Trainer
Windows 10 UWP MVVM In Depth
ARCH-7: Integrate this! SonicMQ® and the OpenEdge® Reference Architecture Christian Stiller Technical Architect.
Model View ViewModel Architecture. MVVM Architecture components.
Module 10: Data Access in ASP.NET. Overview Overview of the ASP.NET Data Access What is Data Access List of Data Source Control What is Data Bound How.
Course Introduction Svetlin Nakov Telerik Corporation
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Programming with MVVM Miguel A. Castro Architect -
/DEV/TM #1 Building Cross-Platform Apps with Xamarin and MvvmCross Flavius-Radu DEMIAN.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
The cutting edge event for ITPros and Devs December 7-8, 2013 Athens, Greece Fix it once use it everywhere Elias Markelis MCT, Windows Phone Enthusiast.
Data Binding, Binding Properties Doncho Minkov Telerik School Academy Technical Trainer
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
Jim Fawcett CSE686 – Internet Programming Spring 2014
In Windows 8 Store Applications
Real world Windows Phone development
NoSQL Databases NoSQL Concepts Databases Telerik Software Academy
MVVM Made Simple with Prism
Jim Fawcett CSE686 – Internet Programming Spring 2012
records Database Vocabulary It can be useful to collect information.
Avalon – Using Data In Your Applications
Build Windows 10 UWP MVVM Apps with Prism
Distribution and components
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
Social Media And Global Computing Managing MVC with Custom Models
Unit Testing & Test-Driven Development for Mere Mortals
Web APIs In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application.
Presentation transcript:

Linq-to-Entities, Data Persisters, Master Datail Doncho Minkov Telerik School Academy Technical Trainer

 Data Access Layer  Linq-to-Entities  Linq-to-XML  Accessing the Data Layer  DataContext  Master Detail  Data Persister  Paging  WPF and Databases

 The Data Access Layer is a essential  Used for access to the database  Class Library with single EntityModel class  This way we can use the same DAL with many applications

Live Demo

 When adding a reference to the DAL project  We can instantiate an entity model in the XAML  And set it for DataContext <Window… xmlns:datalayer=" xmlns:datalayer=" clr-namespace:NorthwindDataLayer;assembly= clr-namespace:NorthwindDataLayer;assembly= NorthwindDataLayer"> NorthwindDataLayer">

 After instantiating the EntityModel we can simply bind some of the entities to a ItemCollection  ListBox, ListView, TreeView, etc.  In MVVM it is not possible to access the DAL directly  Done through the ViewModel  In MVVM we need a DataPersister object <TreeView x:Name="TreeViewCategories" ItemsSource="{Binding Categories}"> ItemsSource="{Binding Categories}">

Live Demo

 What is Master Detail?  When selecting a Category  Show category info  Show products in this category <ListView Name="ListViewFamilies" ItemsSource="{Binding}" DisplayMemberPath="FamilyName"/> DisplayMemberPath="FamilyName"/> <ListView DisplayMemberPath="Name" ItemsSource="{Binding ElementName=ListViewFamilies, ItemsSource="{Binding ElementName=ListViewFamilies, Path=SelectedItem}"/> Path=SelectedItem}"/>

 Consider we have the property Categories in the ViewModel  Somehow it gets data from the Model  Since Categories is a IEnumerable we can get its ICollectionView  Now we got the CurrentItem  Can make property Products that returns the products of the CurrentItem

Live Demo

The way to collect information

 The Data Persister is the object that gives data to the Model  Sometimes it is merged with the Model  It could be an EntityDataModel  It could be a Linq-to-XML object  It could just an object we created  How the Data Persister helps?  Easier for mocking (unit testing)  Better reusability

 The DataPersister is the class that makes the connection with the Data (RDB, XML or object)  Responsible for the CRUD  May have validation  With this object the Model is pretty clean  Almost no programming logic  Loose coupling

Live Demo

What is paging and why we need it?

 A memory-management scheme  A computer can store and retrieve data from secondary storage for use in main memory  With paging the application retrieves data from secondary storage in same-size blocks called pages  Why use paging?  Imagine a Database with over a million records  Store them in the dynamic memory at once?  Or take them by pieces with 100 records?

 TODO

Live Demo

With MVVM

 Consider the usual case  You have categories with products in a Database  CRUD operations should be implemented  You have the following:  When selecting the DataContext of the Grid  You get a Person object </Grid>

Live Demo

Questions?

1. Create a database holding continents, countries and town. Countries have name, language, population and continent. Towns have name, population and country. Implement a WPF application that shows the continents in a ComboBox, countries in a ListView and the towns in a ListView and allows master-detail navigation. Use Entity Framework. Use paging and sorting for the long lists. 2. Implement add / edit / delete for the continents, countries, towns and languages. Handle the possible errors accordingly. Implement validation logic. 26

3. Add a flag for each country which should be a PNG image, stored in the database, displayed along with the country data. Implement "change flag" functionality by uploading a PNG image. 27