Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering ExtJS - Second Edition

You're reading from   Mastering ExtJS - Second Edition Learn how to develop advanced and efficient Internet applications with Ext JS

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784390457
Length 400 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Loiane Avancini Loiane Avancini
Author Profile Icon Loiane Avancini
Loiane Avancini
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Sencha Ext JS Overview FREE CHAPTER 2. Getting Started 3. The Login Page 4. The Logout and Multilingual Capabilities 5. Advanced Dynamic Menu 6. User Management 7. Static Data Management 8. Content Management 9. Adding Extra Capabilities 10. Routing, Touch Support, and Debugging 11. Preparing for Production and Themes Index

Creating a Model


As usual, we are going to start by creating the models. First, let's list the tables we will be working with and their columns:

  • Actor: actor_id, first_name, last_name, last_update

  • Category: category_id, name, last_update

  • Language: language_id, name, last_update

  • City: city_id, city, country_id, last_update

  • Country: country_id, country, last_update

We could create one Model for each of these entities with no problem at all; however, we want to reuse as much code as possible. Take another look at the list of tables and their columns. Notice that all tables have one column in common—the last_update column.

All the previous tables have the last_update column in common. That being said, we can create a super model that contains this field. When we implement the actor and category models, we can extend the super Model, in which case we do not need to declare the column. Don't you think?

Abstract Model

In OOP, there is a concept called inheritance, which is a way to reuse the code of existing...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image