+ All Categories
Home > Documents > Flash Camp Chennai - Social network with ORM

Flash Camp Chennai - Social network with ORM

Date post: 04-Jul-2015
Category:
Upload: ria-rui-society
View: 692 times
Download: 1 times
Share this document with a friend
18
Developing Social Network using ORM By N.S.Devaraj
Transcript
Page 1: Flash Camp Chennai - Social network with ORM

Developing Social Network using ORM

By N.S.Devaraj

Page 2: Flash Camp Chennai - Social network with ORM

Good Afternoon!!

Page 3: Flash Camp Chennai - Social network with ORM

Agenda

ORM Introduction

Why ORM ?

How to use ORM ?

Why Generic DAO / Persistent Collections ?

Social Networking Application

Demo

Questions ?

Page 4: Flash Camp Chennai - Social network with ORM
Page 5: Flash Camp Chennai - Social network with ORM

OMG WTF ORM ?

Page 6: Flash Camp Chennai - Social network with ORM

Object-Relational Mapping

maps objects to relational databases maps relational databases to objects

a programming technique for converting data between incompatible type systems in object-oriented programming languages - WikiPedia

Page 7: Flash Camp Chennai - Social network with ORM

Why ORM ?

The ORM World

Full on Objects of objects

Beans Not much else

Classic Procedural with DAO’s

Less DB Work

More DB Work

Procedural Object-Oriented

Page 8: Flash Camp Chennai - Social network with ORM

How to use ORM

to achieve, we need DI / IoC framework (Swiz)

a GenericDAO to be created to manage Business Logic

a Persistent Data collection to reduce server calls

supported with a Push Mechanism to be Sync with Data Source & for Conflict Management

ORM have to allow the DB swap "on the fly"

Page 9: Flash Camp Chennai - Social network with ORM

Data Access Object

DAO is used to do CRUD

operations and access with

Database tables, used to achieve encapsulation

Each DAO instance is

responsible for one primary

domain object or entity.

an object that provides an abstract interface to some types of database or persistence mechanism. - WikiPedia

Page 10: Flash Camp Chennai - Social network with ORM

Why we need GenericDAO?

Mostly we deal with

multiple VO’s to be queried from service

layer.

Using MVC Framework, while dealing with n x VO, we end up with

n x Delegates

n x Commands

n x Events

With GenericDAO, the business logic will be in generic

code.

Unit testing is damn easy

as we can inject values

Page 11: Flash Camp Chennai - Social network with ORM

Advantages

Increases productivity

Apply DRY (Don’t Repeat Yourself)

Principle

Reduces errors

Easy for Unit Testing

Page 12: Flash Camp Chennai - Social network with ORM

Server DAO Model

Data Source

Data Access Object

Business Object

Client

Value Object

Abstract Real World Example

Create, Read, Update, Delete

Delegates CRUD Operations to

calls

creates

receives

SQL Table: Notes

Notes DAO

Library Service

Flex RIA

NoteVO

receives

Perform SQL Queries

Communicates with

Maps SQL Records to

Delegates CRUD Operations to

Page 13: Flash Camp Chennai - Social network with ORM

Client DAO Model

Business Object

DAO

Events

View

VO

Abstract

Create, Read, Update, Delete

Delegates CRUD Operations to

dispatches

creates

receives

PC

Push

Delegate Update Notes Beans

Generic DAO

Signals

Skinnable Component

NoteVO

Real World Example

Service Results to

receives

Perform functions

Delegates CRUD Operations to

dispatches

PC

Push

Delegate Update

Page 14: Flash Camp Chennai - Social network with ORM

Why Persistent Collections?

Page 15: Flash Camp Chennai - Social network with ORM

Social Network App

Persons

Notes(updates) – files, replies

Connections

Value Objects Required

Page 16: Flash Camp Chennai - Social network with ORM

DEMO

Page 17: Flash Camp Chennai - Social network with ORM

Questions ?

Page 18: Flash Camp Chennai - Social network with ORM

Thanks For

Twitter @nsdevaraj

GTalk nsdevaraj

Blog http://nsdevaraj.wordpress.com

Code https://github.com/nsdevaraj/SwizDAO

Web http://www.adamstudio.in


Recommended