Class generator

LucaMs

Expert
Licensed User
I'm developing a generator of classes related to database tables, which I hope will be useful to everyone.

Given I'm lazy today(?), I ask you what functions you would put in a typical class that represents an entity (such as a Customer class).

For the moment, I put only normal properties and a "structure" for the validation of the data entered into them.

Classes will be for B4A.

Everything will be a tool in b4j available to all members, so ... collaborate, please :)


Examples would be:

lists of related objects (children);
parent object;
I/O functions;
...
 

DonManfred

Expert
Licensed User
Hey, guys, I'm not writing my personal diary, eh! :)
:D



Don´t talk about things if you wish to get comments... Publish it along with an example

maybe the example you wanted to write (hihi) about the Nothwind-database... :D

Could be a good exmple of showing the greatness of you Class ;-)
 

LucaMs

Expert
Licensed User
Before I create the generator itself (should not be very complicated) I would like to create some templates for a class based on a table in SQLite.

The class should have specific characteristics to be used at its best with B4A.

For this reason, I asked suggestions, because then I would have put this tool available to all.

For the moment I'm writing the class directly (without too much effort) which will then be automatically generated.
At the same time, I developed two classes for the validation of the individual data/fields.

I am still stuck at:

Fields - class properties with validation;
DBFillFromQuery - fills in the fields of the class by taking the data from a db;
DBInsert - writes the "class" in the db.

Maybe I've spent more time for validation.

AddValidValue(ValidValue As Object)
RemoveValidValue(ValidValue As Object)

AddInvalidValue(InvalidValue As Object)
RemoveInvalidValue(InvalidValue As Object)

setValidValues(ValidValues As List) + get

setInvalidValues(InvalidValues As List) + get

for number fields:
setMinValue(MinValue As Object) + get

setMaxValue(MaxValue As Object) + get


Validation messages:
Private mErrorDisplayMode As Int
ENUM
Private mErrorDisplayModeNone As Int: mErrorDisplayModeNone = 0
Private mErrorDisplayModeMsg As Int: mErrorDisplayModeMsg = 1
Private mErrorDisplayModeToast As Int: mErrorDisplayModeToast = 2
Private mErrorDisplayModeLog As Int: mErrorDisplayModeLog = 3

setErrorDisplayMode(ErrorDisplayMode As Int)

setErrorMsg (ErrorMsg As String) + get
setErrorTitle (ErrorTitle As String) + get
setErrorToastLongDuration (LongDuration As Boolean) + get
 
Top