BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there a way to query objects in a non procedural way?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Anthony
Guest





PostPosted: Fri Feb 04, 2005 1:53 pm    Post subject: Is there a way to query objects in a non procedural way? Reply with quote



Hi,

I think there is a big requirement here to have a non procedural way of
querying objects for reports.

Or is it possible already?



Back to top
Jim Cooper
Guest





PostPosted: Fri Feb 04, 2005 2:28 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote





Quote:
I think there is a big requirement here to have a non procedural way of
querying objects for reports.

What do you mean, exactly?

Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Anthony
Guest





PostPosted: Fri Feb 04, 2005 6:08 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote



Quote:
What do you mean, exactly?


What is stopping me from writing fully OO apps is that there is no easy way
i can joing different object collections to generate reports.

I mean there seems to be a lot of programming effort required to generate
reports for an fully OO app.
So is there a SQL based (or like ) component out there that can query object
collections.

It will make our life quiet easy would'nt it?





Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Fri Feb 04, 2005 6:35 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

If your OPF can map to an existing DB format, then you can use SQL for
reports because the DB is a predictable structure.


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/


Back to top
Jim Cooper
Guest





PostPosted: Fri Feb 04, 2005 10:33 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote



Quote:
If your OPF can map to an existing DB format, then you can use SQL for
reports because the DB is a predictable structure.

I don't know how complex Anthony's reports are, but I've always had to
do reports where a very restricted set of objects was required for any
given one. I've handled that by having custom mappers specifically for
loading reports. I also have filter criteria objects that get passed to
the mappers that get used to generate the required SQL.

As a general solution there is OCL, which Bold and ECO use, but I don't
know of an OCL parser (there probably is one somewhere)

Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Sat Feb 05, 2005 8:40 am    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

Quote:
As a general solution there is OCL, which Bold and ECO use, but I don't
know of an OCL parser (there probably is one somewhere)

The problem with OCL is that it always returns objects. You can't do things
like "group by" or "having", because they would not return objects.


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/



Back to top
Jim Cooper
Guest





PostPosted: Sat Feb 05, 2005 11:05 am    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote


Quote:
The problem with OCL is that it always returns objects. You can't do things
like "group by" or "having", because they would not return objects.

I though the whole point of the question was how to get objects back
from a query :-)

Why can't you do "group by" or "having"?

Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Anthony
Guest





PostPosted: Sat Feb 05, 2005 1:00 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote


Quote:
If your OPF can map to an existing DB format, then you can use SQL for
reports because the DB is a predictable structure.


You are right for reports we can use SQL dbms when the data is already
applied to the DB.

But we cannot do it if we need to querry on unapplied data. i.e. in memory
data.
especially when we need to check complex conditions before the data is sent
to
the DB yet.








Back to top
Anthony
Guest





PostPosted: Sat Feb 05, 2005 1:07 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote


Quote:
As a general solution there is OCL, which Bold and ECO use, but I don't
know of an OCL parser (there probably is one somewhere)


What is OCL and its use?



Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Sat Feb 05, 2005 1:48 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

Quote:
I though the whole point of the question was how to get objects back from
a query Smile

Well, that's how he approached the issue, but then went on to explain it was
for reporting. Typically in reporting you want to present data, not
objects.


Quote:
Why can't you do "group by" or "having"?

select
A.Name as Parent, B.Name as Child, Sum(C.Value)
from
blah left join etc
where
A.Type = 'X'
having
Sum(C.Value) > 500

What kind of an object does this return, A,B or C?


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/



Back to top
Peter Morris [Droopy eyes
Guest





PostPosted: Sat Feb 05, 2005 1:50 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

www.omg.org


It's like SQL for objects (almost)


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/


Back to top
Anthony
Guest





PostPosted: Sat Feb 05, 2005 2:20 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

Hi Peter,

Quote:
Well, that's how he approached the issue, but then went on to explain it
was for reporting. Typically in reporting you want to present data, not
objects.


Yes OCL is what i was looking for but didnt knew of its existance so i went
on to mention reports.

regards
Anthony








Back to top
Anthony
Guest





PostPosted: Sat Feb 05, 2005 5:15 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote

I think OCL and flat results for reporting are both requirments.

By the way i found this intresting link while searching the web.

http://longhorn.msdn.microsoft.com/?//longhorn.msdn.microsoft.com/lhsdk/ndp/daconopathreference.aspx

It seems longhorn will have OPath language for this purpose.


Back to top
Jim Cooper
Guest





PostPosted: Sat Feb 05, 2005 6:13 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote



Quote:
Well, that's how he approached the issue, but then went on to explain it was
for reporting. Typically in reporting you want to present data, not
objects.

Which you would want to get from objects, ideally, in an OPF-based
world, wouldn't you?

Certainly for reporting I have not resorted to raw SQL bypassing the OPF


Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Solerman Kaplon
Guest





PostPosted: Mon Feb 07, 2005 9:13 pm    Post subject: Re: Is there a way to query objects in a non procedural way? Reply with quote


Peter Morris [Droopy eyes software] escreveu:
Quote:
select
A.Name as Parent, B.Name as Child, Sum(C.Value)
from
blah left join etc
where
A.Type = 'X'
having
Sum(C.Value) > 500
What kind of an object does this return, A,B or C?

That query is different expressed in a OQL language, but I think if you use a
Value Type Framework, you can get a mixed object in return. I would probably
assign a better name for the Sum, and get a collection of a mixed-object. I
don't know how the OQL was standarized by OMG, but is possible to implement.

Solerman

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.