mdbs99 / james

James is a collection of object-oriented Pascal primitives for Lazarus and Delphi
MIT License
53 stars 20 forks source link

Only one Add() in TDataParams #85

Closed fabriciofx closed 6 years ago

fabriciofx commented 6 years ago

Nowadays, IDataParams has 3 Add() methods:

function Add(const ParamName: string; DataType: TFieldType; Value: Variant): IDataParams; overload;
function Add(const AParam: IDataParam): IDataParams; overload;
function Add(const AParams: IDataParams): IDataParams; overload;

So, my suggestion is to have only one Add() method, like this:

function Add(const AParam: IDataParam): IDataParams; overload;

When we want to save to a file, we can do something like it:

IDataParams ds = TDataParams.New();
ds.Add(TDataParam.New(...));

And, to allow add a IDataParams to a IDataParams, IDataParams show extends IDataParam.

WDYT?

mdbs99 commented 6 years ago

I've just removed the first one. The last, I cannot, because the algorithm should need to execute a loop in all items.