Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Worksheet 4.

VOCABULARY
1. A relational database is a type of database that stores and provides access to
data points that are related to one another.
2. C++ (/ˌsiːˌplʌsˈplʌs/) is a general-purpose programming language created
by Bjarne Stroustrup as an extension of the C programming language, or "C
with Classes".
3. API is the acronym for Application Programming Interface, which is a
software intermediary that allows two applications to talk to each other.
Each time you use an app like Facebook, send an instant message, or check
the weather on your phone, you’re using an API.
4. Xamarin is a free, Cross-platform, open source. It is an app platform for
building Android and iOS apps with .NET and C#.
5. In a software context, the term “wrapper” refers to programs or codes that
literally wrap around other program components. Several different wrapper functions can
be distinguished. They are often used for ensuring compatibility or interoperability
between different software structures.

6. Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is
a programming technique for converting data between incompatible type systems
using object-oriented programming languages. This creates, in effect, a
"virtual object database" that can be used from within the programming language.

7. Snippet is a programming term for a small region of re-usable source code, machine
code, or text.

8. A sandbox is an isolated testing environment that enables users to run programs or


execute files without affecting the application, system or platform on which they run.
Software developers use sandboxes to test new programming code.

9.A schema in computer programming is the organisation or structure for a database.


Vocabulary practice
Match the term with its definition:

1. A relational a) refers to programs or codes that literally wrap


database … around other program components.

2. Xamarin … b) is a general-purpose programming language.

3. A sandbox … c) in computer science is a programming technique for


converting data between incompatible type systems
using object-oriented programming languages.

4. C++ … d) is an isolated testing environment that enables users


to run programs or execute files without affecting the
application, system or platform on which they run.

5. Wrapper … e) is a type of database that stores and provides access to


data points that are related to one another.

6. Snippet … f) is a software intermediary that allows two


applications to talk to each other.

7. API … g) in computer programming is the organization or


structure for a database.

8. A schema … h) is a programming term for a small region of re-usable


source code, machine code, or text.

9. Object–relational i) is a free, Cross-platform, open source. It is an app


mapping … platform for building Android and iOS apps with .NET
and C#.
Reading
Read the text in groups and think of a title for each section.

SQLite

Section 1: How to use data storage in SQLite?

Storing data in SQLite is useful when you have relational data. For example, suppose you
are building an application to manage a library. Each book in the library has one or more
authors, and an author can write multiple books. This kind of relationship can be easily
modeled in a SQLite database.

In this unit, you'll learn how to use SQLite in a Xamarin application by using SQLite.NET.

Section 2: What is SQLite and features?

SQLite is a lightweight cross-platform local database that's become an industry standard


for mobile applications. SQLite doesn't run on a server and is stored in a single disk file on
the device's file system. All read and write operations are run directly against the SQLite
disk file.
The SQLite native libraries are built in to Android and iOS by default; however, the engine
only supports a C/C++ API. This scenario isn't ideal for .NET developers, who want some
way for SQLite and .NET to interact.

Section 3: Why many Xamarin developers use a popular C # container called SQLite.NET?

There are several C# wrappers around the native SQLite engine that .NET developers can
use. Many Xamarin developers use a popular C# wrapper called SQLite.NET.

SQLite.NET is an object-relational mapper. It helps simplify the process of defining


database schemas by enabling us to use the models that are defined in our projects to
serve as the schema. For example, consider the following code snippet:

By using an object-relational mapper, you can take this initial User class and automatically
have it create a database table called User that has columns for Id and Username.

Section 4: SQLite.NET AND ATTRIBUTES

Remember that SQLite.NET is an object-relational mapper, which means you can build our
database schema from C# classes. Let's go back to the previous example of our User class.
SQLite.NET can build our database schema from this C# class, but there are many attributes that
you can add to the class to make modifications to the schema.

Here are some examples of available attributes:

● Table: Specify the name of the table if you want it to be something other than the class's
name.
● PrimaryKey: Specify that a column is the primary key.

● AutoIncrement: Specify that a column should automatically increase in value when a new
row is inserted.
● Column: Specify the name of a column if you want it to be something other than the
property name.
● MaxLength: Specify the maximum number of characters that can be used in the column.

● Unique: Specify that the value in the column must be unique from all other rows.
Going back to the User class, following is an updated version that uses all these attributes:

After you define our C# class to use as our database schema, you need to tell SQLite.NET to create
the table. To do that, use the CreateTable method on the SQLiteConnection class. Here's an
example:

If you call the CreateTable method and the table already exists in the database, it checks the
schema class to see if there are any changes. If there are any changes, the operation becomes an
update, and it attempts to update the database schema.

Self-evaluation
Complete the following self-evaluation section.

1. Entiendo en qué consiste la estrategia de Identifying Key Ideas.


Si
2. La estrategia de Identifying Key Ideas me ayuda a entender las ideas principales del
texto.
Si
3. Entiendo qué es SQLite.
Si
4. Entiendo las características de SQLite descritas en el texto.
Si

You might also like