Response to: How I can handle dynamic data (Marek Mosiewicz) 

Hello Thomas.
I understand that O/R mapping tool is great think in many situations, but not always. 
DataSet does not necessery means 2 tier application (e.g. Net uses is to transfer data 
in
app server scenario)
>From my perspective using old DataSet approach is much better in many situations. It 
>handles data in specific manner becous they are specific. For example any kind of 
>DataSet is aware of some metadata. So You have associated and ready some metadata 
>with Your object in standard way. I know that in 3 thier  business logic can provide 
>such validation (theyu can be very sophisticated, you can produce own engine), but 
>there is many situations where there is no need for complicated validation but You 
>always must check for null values, string length etc. Such validations "has it own 
>place" in DataSet but not in O/R tools. You have no standard metadata availbe to 
>object, no standard way of communication about error etc. (You must write it by 
>yourself). O/R maping approach usually ignore simple fact that java String is not DB 
>NVARCHAR. Database char has limited length and You alwayas must check if Your String 
>does fit into DB field. Sure You can validate it by Yourself but DataSet can do it 
>for You, taking autmaticlly field lengths from database metadata.
It is great benefit if you have contract between your model and controls. If error 
occurs You can focus can be focused on bad field. Fields can be well formatedf 
according to metadata, etc, etc. Somebody who tried DataSet will know how important it 
is. 
But most important problem is dynamic data. I want to help in Compiere Project 
(www.compiere.org) . It has entities based on deifinitions which can be changed at 
runtime. It means that You can't generete Java classes for data becouse it can change 
at runtime. I meet meny projects where such dynamic approch was wery good. There is 
many situations in complicated where You need maximum flexibility. O/R mapping fails 
here. I believe that OJB coould also work with such data. It could have option to map 
data not to classes but to some kind of dataset or XML DOM.
What do You think of it ?
Date: Fri, 03 Jan 2003 12:30:37 +0100
From: Thomas Mahler <[EMAIL PROTECTED]>
Subject: How I can handle dynamic data
Content-Type: text/plain; charset=ISO-8859-2; format=flowed


Hi Marek,

Marek Mosiewicz wrote:
 > Hello
 >
 > OJB is really good think. I have question about report queries. I
 > need to handle fully dynamic data which cant be known at compile
 > time. Can report query be used with relation ?

Yes, ReportQueries can be used smoothly in such a scenario!
But also *normal* queries could be an option, as the whole OJB metadata 
layer is completely dynamic and can be manipulated as runtime!

 > I plan to create some
 > kind of dataset ala Delphi or ADO.Net DataSet.

But aren't these technologies quite similar to JDBC ResultSet?
Those technologies don't provide O/R mapping features, but a thin 
abstraction of a database cursor!

 > I believe that I can
 > fill it with my own rowreader but I dont know how OJB saves data
 > (what I have to modify to instruct OJB to take data from my dataset
 > when saving changes is ?)  OJB must also know how navigate via my
 > DataSet relations It would be good to create such standart dataset
 > for Java. Only known solution to me is Borland dataset avaialable in
 > JBuilder.

Which is quite similar to the delphi stuff!

 > It would be great to have OpenSource equivalent or maybe
 > someone knows any. It could be one more API to OJB which could be
 > dynamic by nature (Sun seems to ignore such need as only standard
 > datamodel in Java is JavaBean which is static)

The Delphi and ADO approach of datasets make sense if you are using 
databound GUI widgets. These techniques have been used in typical 
2-layer applications.

But in modern multi-tier applications developer prefer to use proper O/R 
tools to avoid the inherent deficits of 2-tier architectures.

Maybe I am missing something fundamental here, but I don't see the 
benefit of your proposed solution. Can you give some further explanation?

cheers,
Thomas






--------------r-e-k-l-a-m-a-----------------

Super tanie kwatery narciarskie.
Od 300 zł/osoba/tydzień
http://wycieczki.onet.pl

Reply via email to