Introduction to .NetTiers

Slides:



Advertisements
Similar presentations
JTX Overview Overview of Job Tracking for ArcGIS (JTX)
Advertisements

Access Lesson 2 Creating a Database
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
EE-Video Yossi Biton Nir Yakobovski Outline  The concept  Main functionality  Challenges & Solutions  Design considerations Layers Class diagram.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Database Software Application
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Module 3: Table Selection
Database Lecture # 1 By Ubaid Ullah.
Entity Framework Code First End to End
Databases and LINQ Visual Basic 2010 How to Program 1.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
AUTOMATION OF WEB-FORM CREATION - KINNERA ANGADI – MS FINAL DEFENSE GUIDANCE BY – DR. DANIEL ANDRESEN.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
SQL Triggers, Functions & Stored Procedures Programming Operations.
DBS201: Data Modeling. Agenda Data Modeling Types of Models Entity Relationship Model.
SQL Basics Review Reviewing what we’ve learned so far…….
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Chapter 12 Introducing Databases. Objectives What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and.
Getting started with Accurately Storing Data
CompSci 280 S Introduction to Software Development
ASP.NET Programming with C# and SQL Server First Edition
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Fundamentals of DBMS Notes-1.
Chengyu Sun California State University, Los Angeles
Microsoft Visual Basic 2010: Reloaded Fourth Edition
COMP 430 Intro. to Database Systems
Visual Basic 2010 How to Program
Project Management: Messages
Oracle Application Express (APEX)
Chapter 5 Database Design
Working in the Forms Developer Environment
Practical Office 2007 Chapter 10
© 2016, Mike Murach & Associates, Inc.
Introduction to Microsoft Access
Active Directory Administration
Entity Framework By: Casey Griffin.
Error Handling Summary of the next few pages: Error Handling Cursors.
Database Management  .
ADO.NET Entity Framework
Populating a Data Warehouse
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Populating a Data Warehouse
Populating a Data Warehouse
James Blankenship March , 2018
Chapter 5 Sequences.
Populating a Data Warehouse
Access Lesson 2 Creating a Database
Populating a Data Warehouse
CIS16 Application Programming with Visual Basic
MS Access and Database Connections
Web Programming Language
CS122 Using Relational Databases and SQL
Access: Access Basics Participation Project
CS1222 Using Relational Databases and SQL
TechEd /3/ :48 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Chapter 11 Managing Databases with SQL Server 2000
CS122 Using Relational Databases and SQL
Unit J: Creating a Database
Presentation transcript:

Introduction to .NetTiers By Thomas Oscarson

.NetTiers is a free set of code generation templates What is .NetTiers? .NetTiers is a free set of code generation templates Uses the Microsoft Enterprise Library Application blocks Which provides reusable application blocks: Data caching Data access Exception handling Logging, etc Requires CodeSmith for generating the code

What is CodeSmith Tools? CodeSmith is a code generation tool Designed to reduce the need to write repetitive code To provide a consistent style through the use of templates which you provide (.NetTiers is just one set of templates) Gives you the ability to create your own templates Syntax is similar to ASP.NET

Why use .NetTiers with CodeSmith? You can use .NetTiers and CodeSmith to generate multiple tiers of an application automatically Ex: The database, server and browser/client tiers Database level changes are easier to accommodate, with less rewriting of code Repetitive coding is greatly reduced, .NetTiers does it for you by providing a strong set of templates .NetTiers will even generate unit tests The templates are open source so you can always include custom code templates or make changes

.NetTiers Generated DAL .NetTiers can generate a data access layer for you given an existing database In CodeSmith you just need to point .NetTiers to the database and it can automatically generate code to use that database Generate enumerators, entities, relationships, collections, etc Using strong typing

Say you want to have an enumerator for UserType Enumerators Say you want to have an enumerator for UserType .NetTiers can generate a table for you provided: There is a table for UserType in the database The table has a primary key and a unique key defined as the first and second columns in the table, and optionally a description column may be defined The first column is used for the values of the enumerator (usually an INT identity column), the second column is used for the names The different UserTypes which you want to have in the enumerator are already added to the table

Enumerators continued Tell .NetTiers that the table is an enumeration table Generate the code .NetTiers will produce an enum called UserTypeList, which will have all the values present in the database at that time If the enumerator ever needs to change: Make the changes to the table Re-generate, and the enumerator will reflect the changes

Entities .NetTiers entities are object oriented representations of database tables Say you have a User table, an entity from that table would be one row representing one user The User entity would have all the values for that row, for example UserId, Username, FirstName LastName, and PhoneNumber, each of which are strongly typed Individual entities can be manipulated and changed without affecting the database Entities have a state called the EntityState, it can have any of the following values: Added, Changed, Deleted and Unchanged

Entities can be cached by .NetTiers Entities continued Entities can be composed of other entities or even collections of entities Ex: A document entity may contain a collection of note entities View objects are not entities, they are similar but they do not have a state since they do not persist in the database (you cannot write to a view) Entities can be cached by .NetTiers Entities are generated in their own project

Datarepository and Providers The Datarepository is what is responsible for loading and saving data There is only one Datarepository, but many providers Providers are generated for each type of entity Ex: The Document table would have a provider called DocumentProvider

Providers expose a common set of methods such as Read: GetAll(), GetByPrimaryKeyID(), GetByStoredProcedure()… Write: Insert, Update, Delete, Save… These methods are only a starting point Ex: To get all Documents written by Tom, you might use: DataRepository.DocumentProvider.GetByAuthorName

.NetTiers will discover stored procedures based on the name In order to do the last example a stored procedure would have been needed By default .NetTiers will not generate a method or procedure to GetByColumnX, you need to define a procedure to do so The procedure also can take multiple parameters, you are not limited to just one Ex: GetByFirstNameAndLastName might be desirable .NetTiers will discover stored procedures based on the name Ex: If the stored procedure starts with a table name it can be included in the generation

When you do the actual generation .NetTiers will generate a report Generation Report When you do the actual generation .NetTiers will generate a report Telling how many objects it create How many errors (hopefully none) Quick configuration information Sample API usage Then details of the files it generated (this is where you would see where any errors may have occurred)

Demo / Questions