SEARCH
TOOLBOX
LANGUAGES

How is data managed in my application?

From Morfik Wiki

Jump to: navigation, search

When you first start to think about creating a Web application one of the most important considerations is how are you going to manage your data. How and where will you store it? How easy or how hard is it going to be to retrieve it and present it in a visually pleasing manner?

When working with Morfik you can at ease that you will be able to easily store and retrieve your information and that you will be able to present it with style. Morfik offers native, built-in, support for database programming. Actually, Morfik was conceived, right from the start to work with a database and to create applications which are database driven. This and other articles of this documentation will provide a quick view to all aspects of database programming with Morfik, from creating tables to accessing external, third-party, databases.

It can be said that when working with Morfik, the database provides a lot of the structure of your application as it is tightly coupled with how visual elements are designed and put together. The creation of the web interface for presenting database information will, therefore, also be extensively covered in this and several other articles.

The information in the series of articles that cover database development with Morfik is focused on creating complex Web application projects with a server side component, as this enables the usage of database management systems. Only a subset of this information applies to Morfik Application projects without a server side component, which use XML data sources.


Contents

Database Theory

A Database is a set of records stored in a specific way as to facilitate its retrieval and its usage as personal or business information. Databases are generally managed through the usage of specialized software which, generally known as a Database Management System (DBMS).

There are several architectures that are used to store and manage Databases the most often used is known as the Relational Database an is the one adopted by Morfik's built-in database. << read more link>>

Required Concepts and Notions

Concepts with which the Morfik user should be familiar include tables and data types, indices, primary and foreign keys as well as relationships and constraints.

A basic knowledge of SQL will make some of the text easier to understand but is not technically a requirement since you will have links to supporting topics which go over the major SQL constructs which are normally used from within a Morifk XApp (Morfik built, web based application).

Note Almost all SQL commands in this guide, except when otherwise specified, are written in Firebird’s specific SQL dialect. Exceptions might exist when covering work with external databases and will be clearly indicated.

The Default Database

Morfik has a built-in database management system which is used by default in all new projects. This makes it very easy to start new projects from scratch in Morfik, since there is no need to request database access from a database or network administrator or any such formalities. Of course, you still have to go through the appropriate steps in order to deploy a production application, but there is no delay in getting started.

The built-in database is a full featured relational database management system called Firebird. Morfik makes use of many advanced features of Firebird transparently allowing the developer to benefit from them without having to learn how to use them directly. This allows developers to quickly go from being a novice to creating sophisticated data driven applications.

Every Morfik Web Application project has an associated default database as part of the project’s structure. The default database that bears the same file name as the project it belongs too, with a slightly different extension (.mxd). This means that you are creating a new database every time you create a new project. From the Power Menu, or from the Project tab of the Ribbon when you are in Project View, you can create new tables right within the Morfik development environment without having to resort to any external tool.

Database Driven Applications/Sites

Morfik was designed, from the ground up, for the creation of database driven applications and websites. Since data access is not an addition, but an integral part of the design of the product, the very manner in which you design an application or site is heavily influenced by what data is going to be shown. It is possible to create totally dynamic applications, where all content comes directly from database tables and no static content is used. Again, due to how the Morfik development environment and the Morfik Framework are built this is, actually, the preferred way of creating applications/sites.

It is quite simple, with Morfik, to create sophisticated data-driven applications. This makes Morfik the tool of choice for any kind of Web-based applications which need to dynamically alter its layout, and content.

Visual Development

The vast majority of work that goes into a Morfik application is in the form of visual design and configuration. This holds true for the database access parts as well. Of course, there will be times when a developer will need or want to write some database access code, for a specific purpose. Morfik makes it easy for those with the necessary skills to do so. Most of the work, however, can be accomplished through a set of visual designers and wizards.

Morfik includes visual designers for Tables, Queries and Relationships as well as Wizards for creating these objects and the visual interface elements which will be associated with them.




Tables

Tables are the structures in which you store information in a relational database. Morfik treats Tables as first class citizens within a project and they can be viewed individually directly in the Project View.

How you store information in tables is a very important aspect of creating a Web application. Morfik provides a default database for each project that is created and provides the means necessary for you to directly create your tables in it with the Table Designer. Morfik also allows you to add Tables from other databases to your project where they will be perceived as any other table in the project, but will not be editable. <<read more>>

Table Designer

Queries

A query is a precise request for information retrieval from an information storage system of some type. When working with Morfik we will be primarily referring to database queries which are generally expressed in the form of a SQL language expression. A query specifies exactly what information the user wants to retrieve from the database in order to fulfill the intended purpose of the application being built. This is done by specifying which fields from which tables the user needs to retrieve and under which set of conditions (Parameters).

In Morfik queries are first class citizens within your project and are independently displayed in the Project View. Within the Morfik development environment we use the Query Designer to create queries either visually or through the pass-through SQL editor which allows you to directly enter any valid SQL statements. <<read more>>


Query Designer

The Query Designer is a specialized part of the Morfik development environment which allows you to define queries for usage in your application, either visually or by writing SQL language statements.

In its Design View, the Query Designer strives to provide as easy an interface for the creation of queries as possible. In Code View, the Query Designer allows you to directly enter any SQL language statement which is valid for the target database. <<read more>>


Displaying Information

Most projects built with Morfik will ultimately be a website or a Rich Web Application, though you can use Morfik to build pure Web Service based servers. The ultimate goal of most Morfik projects thus, is to display information in a useful and agreeable manner to an end user. Morfik's visual approach to Web application development is particularly suited to allow users to create a rich Web experience with very little recourse to writing code.