Search icon CANCEL
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
Delphi Programming Projects

You're reading from   Delphi Programming Projects Build a range of exciting projects by exploring cross-platform development and microservices

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789130553
Length 248 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
William Duarte William Duarte
Author Profile Icon William Duarte
William Duarte
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Building an Instagram Clone FREE CHAPTER 2. Building a Facebook REST API 3. Cross-Platform Services for Windows, iOS, and Android 4. Design Patterns to Build a Multi-Database System 5. Creating GUI Apps with FireMonkey 6. Implementing Tethering to Create a Remote Control 7. Building Microservices Using the RAD Server 8. Other Books You May Enjoy

Models for a database – objects

To interact with a database (at least for what is being discussed in this chapter), we need a template, which will be the equivalent of the fields in the database tables.

The process is very simple. Let's create an object for each table in our database; regardless of whether it is SQL Server or PostgreSQL, we will only have one object per entity:

  • users
  • products
  • customers

The users object

The idea to facilitate the maintenance and reading of the code is to separate a unit for each entity. In this case, we will need to create three new units for each table. To do so, follow these steps:

  1. Open the Delphi IDE.
  2. Create a new VCL project.
  3. Create three new units (File | New | Unit - Delphi...
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