All Projects → jcmoraisjr → jcore

jcmoraisjr / jcore

Licence: other
Some FPC classes and frameworks I have implemented so far

Programming Languages

pascal
1382 projects
CSS
56736 projects

Projects that are alternatives of or similar to jcore

Prack
Simple and Scalable Web Server 🚀
Stars: ✭ 14 (-46.15%)
Mutual labels:  freepascal
fano
Pascal web application framework
Stars: ✭ 21 (-19.23%)
Mutual labels:  freepascal
WebView4Delphi
WebView4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows.
Stars: ✭ 157 (+503.85%)
Mutual labels:  freepascal
pasgltf
An Object-Pascal-native GLTF 2.0 low-level-data loader and writer for GLTF and GLB files
Stars: ✭ 22 (-15.38%)
Mutual labels:  freepascal
slf4p
A simple logging facade for Object Pascal (Delphi and FPC)
Stars: ✭ 28 (+7.69%)
Mutual labels:  freepascal
libpascurl
libPasCURL is delphi and object pascal wrapper around cURL library. Library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP.
Stars: ✭ 58 (+123.08%)
Mutual labels:  freepascal
sizectrl
TSizeCtrl v8.2
Stars: ✭ 16 (-38.46%)
Mutual labels:  freepascal
Bauglir-WebSocket-2
Copy of https://code.google.com/archive/p/bauglir-websocket/
Stars: ✭ 15 (-42.31%)
Mutual labels:  freepascal
torokernel
This repository contains the source code of the unikernel toro
Stars: ✭ 107 (+311.54%)
Mutual labels:  freepascal
raster-master
Raster Master Sprite/Icon/Map editor for Windows 10/11 that generates RayLib code / Put image and map code for Open Watcom, gcc, AmigaBASIC, Amiga C, Amiga Pascal ,QuickBasic, QB64, Quick C, Turbo Pascal, freepascal, Turbo C, Turbo Basic, Power Basic, FreeBASIC, GWBASIC, BASICA, PC-BASIC,, DOS XLIB LBM/PBM
Stars: ✭ 40 (+53.85%)
Mutual labels:  freepascal
brookframework
Microframework which helps to develop web Pascal applications.
Stars: ✭ 161 (+519.23%)
Mutual labels:  freepascal
atom-language-pascal
Pascal language support in Atom
Stars: ✭ 25 (-3.85%)
Mutual labels:  freepascal
iocp-delphi
Windows I/O Completion Port wrapper class for Delphi and Free Pascal
Stars: ✭ 47 (+80.77%)
Mutual labels:  freepascal
lazarus-beginners-guide
A book written for new Lazarus users, named "Beginners’ Guide to Lazarus IDE". Moved to: https://gitlab.com/adnan360/lazarus-beginners-guide
Stars: ✭ 26 (+0%)
Mutual labels:  freepascal
setup-lazarus
Set up your GitHub Actions workflow with a specific version of Lazarus
Stars: ✭ 29 (+11.54%)
Mutual labels:  freepascal
DirectoryWatcher
Watch changes in directories
Stars: ✭ 70 (+169.23%)
Mutual labels:  freepascal
fpos
Free Pascal Operating System (FPOS) is a operating system consists of a minimal kernel built on FreePascal. It contains a Scheme implementation of a hard drive (ATA) driver, keyboard (PS2), serial (8250 UART), FAT32 filesystem and a small real time clock manager. The project was built to experiment with developement of operating system using a h…
Stars: ✭ 36 (+38.46%)
Mutual labels:  freepascal
ShellRemoteBot
Shell remote control from telegram (SSH/terminal emulator)
Stars: ✭ 28 (+7.69%)
Mutual labels:  freepascal
bcrypt
BCrypt is a password hashing function
Stars: ✭ 138 (+430.77%)
Mutual labels:  freepascal
fano
Pascal web application framework
Stars: ✭ 90 (+246.15%)
Mutual labels:  freepascal

JCore

Some classes and frameworks I have implemented so far.

  • OPF
  • Dependency Injection Container
  • Expression Parser

OPF

Features being implemented:

  • Entities inherits from TObject and declares native data types
  • Support of any data type, registering new data mediators for unsupported PTypeInfos
  • Auto and manual mapping (object <-> storage mechanism)
  • Auto and manual model (class infos; metadata)
  • Native drivers -- mapping straight to database: no mediators or conversions
  • Bulk retrieve -- instantiate lots of objects with one query
  • Lazy loading -- load objects or attributes only on demand
  • TDD -- test driven development
  • Lazarus wizards for manual mappings, manual model and persistence configuration
  • API docs

There are some docs here.

Some missing pieces before stabilize 0.4:

  • Support of native data types
  • Manual transactions
  • Criteria improvement

Dependency Injection Container

Classes which help you separate specifications from implementations, as well as give you the hability to override default implementation from a framework with your own classes.

  • Declare your specification using interfaces
  • Register at least one implementation
  • Inject an implementation
  • Support of qualifiers

Samples:

TJCoreDIC.Register(IYourIntf, TYourImpl, jdsApplication);
...
TJCoreDIC.Locate(IYourIntf, VAnIntfVar);

Using qualifier:

TJCoreDIC.Register(IPayment, ‘cash’, TCashPayment, jdsApplication);
TJCoreDIC.Register(IPayment, ‘plastic’, TPlasticPayment, jdsApplication);
TJCoreDIC.Register(IPayment, ‘paypal’, TPaypalPayment, jdsApplication);
...
TJCoreDIC.Locate(IPayment, ‘paypal’, VPayment);

Expression Parser

An expression parser with an extensible function and operation library as well as support to variables.

The library is as fast as it can be: when the formula is changed, it is parsed in order to create an array with all operations, in the correct order. All results are referenced and reused without moves and copies. Point to pointers.

A simple calc:

VExpression := TJCoreExpression.Create('2+2');
try
  writeln(VExpression.VarValue);
finally
  FreeAndNil(VExpression);
end;

Using vars:

VExpression := TJCoreExpression.Create;
try
  VExpression.Vars.Variable['x'] := 2;
  VExpression.ParseExpression('2+x');
  writeln(VExpression.VarValue);
  VExpression.Vars.Variable['x'] := 4;
  writeln(VExpression.VarValue);
finally
  FreeAndNil(VExpression);
end;

User defined function:

TSinFunction = class(TJCoreExpressionFunction)
public
  function MaxParams: Integer; override;
  function MinParams: Integer; override;
  class function Name: string; override;
  procedure VarCalc; override;
end;

function TSinFunction.MaxParams: Integer;
begin
  Result := 1;
end;

function TSinFunction.MinParams: Integer;
begin
  Result := 1;
end;

class function TSinFunction.Name: string;
begin
  Result := 'sin';
end;

procedure TSinFunction.VarCalc;
begin
  Res^ := Sin(Params[0]^);
end;

begin
  JCoreExpressionLibrary.RegisterFunctions([TSinFunction]);
  VExpression := TJCoreExpression.Create('sin(30)');
  try
    writeln(VExpression.VarValue);
  finally
    FreeAndNil(VExpression);
  end;
end;

User defined operation:

TModOperation = class(TJCoreExpressionOperation)
protected
  class function InternalOperatorToken: string; override;
public
  function Priority: Byte; override;
  procedure VarCalc; override;
end;

class function TModOperation.InternalOperatorToken: string;
begin
  Result := 'mod';
end;

function TModOperation.Priority: Byte;
begin
  Result := 15;
end;

procedure TModOperation.VarCalc;
begin
  Res^ := Val1^ mod Val2^;
end;

begin
  JCoreExpressionLibrary.RegisterOperations([TModOperation]);
  VExpression := TJCoreExpression.Create('3 mod 1');
  try
    writeln(VExpression.VarValue);
  finally
    FreeAndNil(VExpression);
  end;
end;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].