| View previous topic :: View next topic |
| Author |
Message |
Anthony Guest
|
Posted: Fri Feb 04, 2005 1:53 pm Post subject: Is there a way to query objects in a non procedural way? |
|
|
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
|
Posted: Fri Feb 04, 2005 2:28 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Fri Feb 04, 2005 6:08 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Fri Feb 04, 2005 6:35 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
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
|
Posted: Fri Feb 04, 2005 10:33 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Sat Feb 05, 2005 8:40 am Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Sat Feb 05, 2005 11:05 am Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Sat Feb 05, 2005 1:00 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Sat Feb 05, 2005 1:07 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Sat Feb 05, 2005 1:48 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| Quote: | I though the whole point of the question was how to get objects back from
a query
|
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
|
|
| Back to top |
|
 |
Anthony Guest
|
Posted: Sat Feb 05, 2005 2:20 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
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
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Sat Feb 05, 2005 6:13 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
| 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
|
Posted: Mon Feb 07, 2005 9:13 pm Post subject: Re: Is there a way to query objects in a non procedural way? |
|
|
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 |
|
 |
|