#1 2015-05-11 14:37:20

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

ConnectionTimeOutMinutes as published property

Hi @ab, ConnectionTimeOutMinutes can be modified as as published property for storing with TSynDefinition ?

Thanks.

EMartin.


Esteban

Offline

#2 2015-05-11 16:04:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: ConnectionTimeOutMinutes as published property

What do you call TSynDefinition?

Offline

#3 2015-05-11 16:15:55

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: ConnectionTimeOutMinutes as published property

Sorry for my mystake, I mean TSynConnectionDefinition.

Thanks.


Esteban

Offline

#4 2015-05-11 19:19:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: ConnectionTimeOutMinutes as published property

ConnectionTimeOutMinutes  is a HTTP property, whereas TSynConnectionDefinition is a REST definition.

So ConnectionTimeOutMinutes should not be part of TSynConnectionDefinition.

You can add your own settings, just by inheriting the class, or even better by nesting the class within other classes.

Offline

#5 2015-05-11 19:52:26

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: ConnectionTimeOutMinutes as published property

ConnectionTimeOutMinutes is in TSQLDBConnectionProperties, I think this property is candidate to be configurable and storable. But I'll make my own implementation.

Another util modification, for me, could be that TSQLDBConnectionProperties can have a "Name" property, my application server can have different database connections to different engines, then I can to identify each connection by name (util legacy from RemObjects). Of course TSynConnectionDefinition should have this property too.

Can you make TSQLDBConnectionProperties.DefinitionTo virtual ? so I can manage added properties to TSynConnectionDefinition. The same for TSynConnectionDefinition.CreateFromJSON and TSynConnectionDefinition.SaveToJSON.

Thanks.


Esteban

Offline

#6 2015-05-12 08:23:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: ConnectionTimeOutMinutes as published property

TSynConnectionDefinition just contains what is needed for both RESTful and SynDB instance creation.
Other parameters should be set after the TSQLRest or TSQLDBConnectionProperties instances are created.
IMHO you should not put all your information in TSynConnectionDefinition, but in another parent class.

I defined the methods as virtual.
See http://synopse.info/fossil/info/6692f83229

But I would not go into this direction, personnally.
I would define dedicated TSynPersistent and TSynAutoCreateFields classes for the settings, containing TSynConnectionDefinition, not inhering from TSynConnectionDefinition.
Then use ObjectToJson() serialization.
See e.g. how unit dddInfraSettings define its settings.

Offline

Board footer

Powered by FluxBB