Posts

Showing posts with the label PureBasic

The Single or stand-alone table (part 3)

Welcome Back! In my previous entry we defined the needed Procedures in a Stand-Alone table data layer Module.  In this blog entry we will begin to build out these Procedures. The first step in building the FighterSize Module is to create our public interface, or Public Declares. Declare LoadComboName(cbData.i) Declare LoadListViewName(lvData.i) Declare LoadListIcon(liData.i) Declare.i Init(*Class.FighterSize) Declare.i Find(FighterSizeID.i, *Class.FighterSize) Declare.i FindByName(FighterName.s, *Class.FighterSize) Declare.i Save(*Class.FighterSize) Declare.i Delete(*Class.FighterSize) Declare.i Validate(*Class.FighterSize) Declare.i DeleteValidate(*Class.FighterSize) Before we dive into creating our public procedures there are a couple of housekeeping things we need to address first. Our first Procedures to create will be Private Procedures.  We are going to build an Initialize and a Dispose Procedure. These will be called by our Public Procedures to ...

The Single or stand-alone table (part 2)

 Welcome back! In this post I will begin to define the fundamental building blocks of the Database Table from the code side using PureBasic. A Table is nothing more than a collection of data fields, where each row is a distinct element of the type defined by the Table.  This has nothing to do with the how or where the table is saved. Your table could be a JSON Structure, a standard TXT File, an XML Table or a SQLite table.  Already we have separated the table from its storage.  This has been completed by the use of the DB Module. So, in your mind separate the storage from the Table or Data.  Here we will be defining the table Data itself. In PureBasic this is BEST Done with a Distinct Model dedicated to an individual structure, or field elements. I'm going to continue using my Galactic Conquest Game as the source of examples for this series of posts.  As our Example of a stand-alone table, will use the FighterSize table. Here we define the Fighters which ca...

Defining Database Tables (part 1)

 Welcome back! In this blog entry we will begin the definition of a Table DB Module, which will be built on top of our DB Module. As you will remember the DB Module is the lowest level Module in our Database Layer. He is the only module who interacts with the database, no other module in your application should directly touch the database. Now I will begin the definition of the Modules who sit atop DB. There are three distinct table Structures that have to be considered.  Single, or stand-alone, Table - examples of this the bottom Module of the Parent Child Structure, or and Class which has No Children.  A Static list of Values, a List of Error Codes. This is often referred to an "is a" paradigm. if an object is a ErrorType, where ErrorType is Not a child. Parent-Child Table - A great example of this would be Galaxy, a Galaxy has Many SolarSystems, each SolarSystem has many Planets, Each Planet has Many Factories.  As you can see the Parent Child Table Structure is ...

Module DB, the foundation of any Data Layer.

 At the heart of any application is the database. Therefore, this segment of the application should be bulletproof.  To prevent repeating code, it should start with the module I call DB.  Module DB it the bottom most module, it is the actual module which interacts with the database.  If later you decide to migrate your database from SQLite to say Postgres, then all you will need to do is tweak THIS Module.  This module will also contain the Enumeration of "STATE".  By this I mean the current state of the record, is it: New - Created but not yest saved to the database. Clean - The Record is "Untouched". It is Identical to the record saved in the Database. Dirty - The record was loaded from the database, but it has been changed in some manner. DeleteRec - The record has been marked for deletion, but the user has yet to commit the delete to the database. NewDirty - The record is new, but the User is changing something, or the new record is being modified but h...

PAHLabs Blog goes Live

 Welcome All! Today with this post the PAHLabs Blog goes Live. It is a goal of mine to share with others my passion in Software Development, Coding and Application Design.  I plan to use this blog to reach out to those of like minds, and especially those wanting to learn. Though in my 40+ year career in software development I have written many, many software languages, this blog is mostly going to focus on PureBasic.  I have an accompanying website ( https://www.PAHLabs.com ) where I have both free and licensed software products, developed using the PureBasic Language.  You can find out more about PureBasic at  PureBasic Here in my blog, I will begin explaining how these applications were written, and to share with you how I develop software.   The first thing about software development I wish to share with you is that software development is all about solving problems. A software program is nothing more than a solution to a problem.  As with ALL ...