Wednesday, April 06, 2005

Jason.OPF.1

Jason says:
yes?
SQL.com.my (3.5.77.365) says:
can i ask u something?
Jason says:
yes?
SQL.com.my (3.5.77.365) says:
i am trying to implement a OPF framework
SQL.com.my (3.5.77.365) says:
Object Persistent Framework.
SQL.com.my (3.5.77.365) says:
i don't want to rely on remobject data abstrat.
SQL.com.my (3.5.77.365) says:
do u know what is Object persistent framework?
Jason says:
u want to implement it urself?
SQL.com.my (3.5.77.365) says:
yes
Jason says:
maybe u can use model maker for class modelling?
Jason says:
OPF is like business object rite?
SQL.com.my (3.5.77.365) says:
there are related
SQL.com.my (3.5.77.365) says:
ok. a brief explanation to u
SQL.com.my (3.5.77.365) says:
OPF 's Object means the OOP's object.
SQL.com.my (3.5.77.365) says:
Persistent meas a data storage for the object. most of the time , it refer to Database's Table. But it can be a text file, xml file too , or a string.
Jason says:
ic
SQL.com.my (3.5.77.365) says:
In the world of OO, we use object to perform tasks, and it a good design of class model could perform very complex task.
SQL.com.my (3.5.77.365) says:
the problem with OO world is not easy to persist it. It means we want to save the state of object for later use.
Jason says:
ok
SQL.com.my (3.5.77.365) says:
thus we need a OPF to both use the OO's strength but has a way to persist it.
SQL.com.my (3.5.77.365) says:
in business application, persistent layer is usual a relational database.
SQL.com.my (3.5.77.365) says:
by using the DataSet.FindField('Code').AsString is not a good OO programming.
SQL.com.my (3.5.77.365) says:
if use something like this:
var I, I1: TInvoice;
begin
I := TInvoice.Create;
I.Code := '300-A01';
I.DocAmt := 300.00;
showmessage(i.code);
I.Free;
end;
SQL.com.my (3.5.77.365) says:
that's much elegant and neat.
SQL.com.my (3.5.77.365) says:
but the problem is how to persist it with using such approach and data-aware controls in delphi.
SQL.com.my (3.5.77.365) says:
i have solved the data-aware controls problem with the above TInvoice class by introduce a IDataStore interface
SQL.com.my (3.5.77.365) says:
ok. not too much details for the IDataStore here. my problem here is how could I persist the object state to RDBMS table?
Jason says:
so u need OO-relational mapping for that?
SQL.com.my (3.5.77.365) says:
ORM , OPF are basically go hand in hand.
SQL.com.my (3.5.77.365) says:
if want to deploy true OPF , the ORM always come along.
SQL.com.my (3.5.77.365) says:
in database world, a table row has state -> inserted, updated or deleted.
SQL.com.my (3.5.77.365) says:
thus the TDataSetProvider's resolver trying to generate the proper SQL for the three status to do updating as well as generate complex sql updating operations for nested dataset.
SQL.com.my (3.5.77.365) says:
this i guess is hard for me to do...
SQL.com.my (3.5.77.365) says:
i study the TSQLResolver in provider.pas and see how the SQL was generated and pass to IProviderSupport object to execute the SQL statement.
Jason says:
why do u want to develop a OPF?
SQL.com.my (3.5.77.365) says:
in object world , we don't have things like object state of updated, inserted, deleted.
Jason says:
the existing ones are not up to ur expectation?
SQL.com.my (3.5.77.365) says:
no.
SQL.com.my (3.5.77.365) says:
nobody reviews their OPF.
SQL.com.my (3.5.77.365) says:
they just give concept only.
SQL.com.my (3.5.77.365) says:
i have studied it for week.
SQL.com.my (3.5.77.365) says:
the DA's solution is closed but still not up to expectation.
SQL.com.my (3.5.77.365) says:
DA's solution is just another midas's clone.
Jason says:
and u think u have time to develop a own one?
SQL.com.my (3.5.77.365) says:
reviews -> reveal.
SQL.com.my (3.5.77.365) says:
i guess should be able.
SQL.com.my (3.5.77.365) says:
i found if using the Tdatasetprovider to perform the database updating operations, then should be allright.
SQL.com.my (3.5.77.365) says:
that's the persistent layer.
SQL.com.my (3.5.77.365) says:
that's the most difficult part to do.
Jason says:
ic
SQL.com.my (3.5.77.365) says:
the rest i almost solve the technical problem.
Jason says:
so u think u technicals are ready for that?
SQL.com.my (3.5.77.365) says:
sort of if using the TDataSetProvider to perform the job.
SQL.com.my (3.5.77.365) says:
is the kbmmw
SQL.com.my (3.5.77.365) says:
is the kbmmw's resolver good?
SQL.com.my (3.5.77.365) says:
i meant the sql statement generator.
Jason says:
kbmmw now has not voice already
SQL.com.my (3.5.77.365) says:
the DA's sql statement generator not too good.
SQL.com.my (3.5.77.365) says:
ic.
Jason says:
how do u mean by good or bad?
SQL.com.my (3.5.77.365) says:
the sql statement generator not easy to implement, especially with the nested part.
SQL.com.my (3.5.77.365) says:
i chase the DA's newsgroup and found there still has bugs in this part.
Jason says:
yeah, guess u have to implement ur own one
SQL.com.my (3.5.77.365) says:
but tdatasetprovider we have use for years, more confident on it.
Jason says:
tdatasetprovider ok ar?
SQL.com.my (3.5.77.365) says:
so far ok...
Jason says:
and the DA one is worse that TDatasetProvider?
Jason says:
that -> than
SQL.com.my (3.5.77.365) says:
not that worst.
SQL.com.my (3.5.77.365) says:
someone report the blob field's problem. i not too sure.
Jason says:
ic
SQL.com.my (3.5.77.365) says:
and they have other ways to write sql too...
Jason says:
if the TDatasetProvider is ok, then what's ur worries?
SQL.com.my (3.5.77.365) says:
it has generator , but it can write own sql .
SQL.com.my (3.5.77.365) says:
because i trace the tsqlresolver and found not too hard to do. haha
SQL.com.my (3.5.77.365) says:
seems like sql generator also easy to write.
SQL.com.my (3.5.77.365) says:
but the nested part is another problem.
SQL.com.my (3.5.77.365) says:
the tdatasetprovider use tree concept to traverse...
SQL.com.my (3.5.77.365) says:
i feel not easy then.
Jason says:
yeah
Jason says:
their tree a lot of pointers
SQL.com.my (3.5.77.365) says:
ya
SQL.com.my (3.5.77.365) says:
i feel the tdatasetprovider doesn't implement in good OO programming.
SQL.com.my (3.5.77.365) says:
if i have time, i can do better then them.
SQL.com.my (3.5.77.365) says:
in fact my problem now is if i use the TClientDataSet to store the Object's properties, then I can have the object state, field's oldvalue and newvalue.
Jason says:
either u use it or u develop ur own one?
SQL.com.my (3.5.77.365) says:
what u meant?
Jason says:
if u don't use TClientDataSet, then what to use?
SQL.com.my (3.5.77.365) says:
i have two IDataStore's implementor, one is the TclientDataSet's data store and another one is using a collection that generate the in-memory storage from class's published RTTI.
SQL.com.my (3.5.77.365) says:
but the RTTI data store doesn't has object state, i still able to do the oldvalue and newvalue.
SQL.com.my (3.5.77.365) says:
if said i able to keep track object state , my problem here is how to generate the SQL doing the updating usnig the collection style?
SQL.com.my (3.5.77.365) says:
using the ClientDataSet style, I can use the provider to generate the sql for me.
SQL.com.my (3.5.77.365) says:
var I, I1: TInvoice;
begin
I := TInvoice.Create;
I.Code := '300-A01';
I.DocAmt := 300.00;
showmessage(i.code);
I.Free;

I1 := TInvoice.Create(TCDSDataStore.Create(ClientDataSet1));
I1.Code := '300-A02';
I1.DocAmt := 400.00;
I1.Free;
end;

SQL.com.my (3.5.77.365) says:
two objects shown above, I using the RTTIDataStore, I1 using the TClientdataset data store.
SQL.com.my (3.5.77.365) says:
I1 i can use the tdatasetprovider to persist the object's state for me.
SQL.com.my (3.5.77.365) says:
but for I is a problem.
Jason says:
so u want to use I1?
SQL.com.my (3.5.77.365) says:
both can use also
SQL.com.my (3.5.77.365) says:
but I lack of the bridge to SQL generator
SQL.com.my (3.5.77.365) says:
"I" means the I variable
Jason says:
maybe u can use I1 first
Jason says:
then later on if u have time, then do ur own SQL generator
SQL.com.my (3.5.77.365) says:
those OPF expert like Scott Ambler, Joanna Carter all propose a framework for SQL generator.
SQL.com.my (3.5.77.365) says:
but they don't give source code, just concept only.
Jason says:
ic
SQL.com.my (3.5.77.365) says:
event the tiOPF also do like that.
Jason says:
so u have to implement their concept
Jason says:
tiOPF doesn't implement it?
SQL.com.my (3.5.77.365) says:
tiOPF do something like those expert propose.
SQL.com.my (3.5.77.365) says:
nvm , just discuss the topic with you. nobody has answer for it...
SQL.com.my (3.5.77.365) says:
i guess the best way is the persistent layer still using the midas way.
Jason says:
just bcoz the exisitng accounting already is midas way?
SQL.com.my (3.5.77.365) says:
then later if i gain more understanding on SQL syntax/grammer, then i can implement my own true OPF. from then, i able to jump to java/c# easily.
SQL.com.my (3.5.77.365) says:
no. because the tools already has.
SQL.com.my (3.5.77.365) says:
even in java i think they have no sql generator like provider too.
SQL.com.my (3.5.77.365) says:
or do you heard anyone has delphi sql generator for object state?
Jason says:
never heard yet
Jason says:
JBuilder got, implemented by Borland
Jason says:
and Microsoft got build in one
SQL.com.my (3.5.77.365) says:
i see.
SQL.com.my (3.5.77.365) says:
since provider can only work be clientdataset, so i can only use clientdataset.
SQL.com.my (3.5.77.365) says:
because clientdataset support delta
SQL.com.my (3.5.77.365) says:
but the drawback is clientdataset performance not good.
SQL.com.my (3.5.77.365) says:
infact, if we have only one dataset and not using the nested dataset, then it is easy to implement own sql generator. i can easily do a framework that can cross DB.
SQL.com.my (3.5.77.365) says:
but with the nested cases, it is not easy then.
Jason says:
yeah, that's why people don't like to use nested ones
SQL.com.my (3.5.77.365) says:
but nested concept is good.
Jason says:
maybe
Jason says:
but I don't like it
SQL.com.my (3.5.77.365) says:
using a single Applyupdates, we can do the posting in a single transaction.
Jason says:
but we seldom have full control in nested one
Jason says:
difficult to understand how it works too
SQL.com.my (3.5.77.365) says:
yes, this is the drawback
Jason says:
I think in real life not many people use nested
Jason says:
it works ok for single master record
SQL.com.my (3.5.77.365) says:
ya
SQL.com.my (3.5.77.365) says:
can we live without nested dataset for the Master detail records?
Jason says:
I think so
Jason says:
but need to use different technique
Jason says:
they have techniques how to apply 2 or more deltas in one transaction
SQL.com.my (3.5.77.365) says:
i see
Jason says:
I'm going to take a shower now
Jason says:
talk to u later
SQL.com.my (3.5.77.365) says:
ok.

0 Comments:

Post a Comment

<< Home