Renaming JQuery to JSql (to avoid starting confusion with jQuery js lib) ?

36 views
Skip to first unread message

Beat

unread,
Dec 21, 2009, 5:38:42 AM12/21/09
to Joomla! CMS Development
I suggest once more to rename Joomla's database class "JQuery" to
"JSql" to avoid further confusion.

I exposed my arguments in several posts here:
http://forum.joomla.org/viewtopic.php?p=1971648#p1971648

and already pointed to the trademark confusion and suggested it a
first time 18 months ago here:
http://forum.joomla.org/viewtopic.php?f=326&t=195747&p=1294048&hilit=jquery#p1294048

On Andrew's suggestion, I'm reposting it here.

More than a legal issue, it's the signal sent to the Joomla community
and the growing confusion with the growing popularity of the
Javascript library of same name that are of concern.

And right now it's quite easy to change, compared to later when
thousands of extensions rely on that class name.

Joseph LeBlanc

unread,
Dec 21, 2009, 9:01:36 AM12/21/09
to joomla-...@googlegroups.com
+1. Although jQuery and JQuery are different things, jQuery and Joomla get used together often enough that "JQuery" is bound to cause considerable confusion.

-Joe

> --
>
> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>

Gergo Erdosi

unread,
Dec 21, 2009, 10:26:58 AM12/21/09
to joomla-...@googlegroups.com
Hi,

I also support this change, because it's very confusing now. If I remember well, there was a request earlier too from a jQuery developer to make this change. However I would rename it to JDatabaseQuery instead, because the query builder is a sub-part of the database class.

---
Gergo Erdosi

Emerson Rocha Luiz

unread,
Dec 21, 2009, 11:00:53 AM12/21/09
to Joomla! CMS Development
+1

Yes, I remember too that is not the fist time that someone ask for
change it, and even on that moment I guess that no one really endorse
continue using Jquery as a name.

On 21 Dec, 13:26, Gergo Erdosi <ge...@joomline.org> wrote:
> Hi,
>
> I also support this change, because it's very confusing now. If I remember well, there was a request earlier too from a jQuery developer to make this change. However I would rename it to JDatabaseQuery instead, because the query builder is a sub-part of the database class.
>
> ---
> Gergo Erdosi
>
> On 21 Dec 2009, at 15:01, Joseph LeBlanc wrote:
>
> > +1. Although jQuery and JQuery are different things, jQuery and Joomla get used together often enough that "JQuery" is bound to cause considerable confusion.
>
> > -Joe
>
> > On Dec 21, 2009, at 5:38 AM, Beat wrote:
>
> >> I suggest once more to rename Joomla's database class "JQuery" to
> >> "JSql" to avoid further confusion.
>
> >> I exposed my arguments in several posts here:
> >>http://forum.joomla.org/viewtopic.php?p=1971648#p1971648
>
> >> and already pointed to the trademark confusion and suggested it a
> >> first time 18 months ago here:

> >>http://forum.joomla.org/viewtopic.php?f=326&t=195747&p=1294048&hilit=...


>
> >> On Andrew's suggestion, I'm reposting it here.
>
> >> More than a legal issue, it's the signal sent to the Joomla community
> >> and the growing confusion with the growing popularity of the
> >> Javascript library of same name that are of concern.
>
> >> And right now it's quite easy to change, compared to later when
> >> thousands of extensions rely on that class name.
>
> >> --
>
> >> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> >> To post to this group, send an email to joomla-...@googlegroups.com.
> >> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.

> >> For more options, visit this group athttp://groups.google.com/group/joomla-dev-cms?hl=en-GB.

Amy Stephen

unread,
Dec 21, 2009, 11:08:03 AM12/21/09
to Joomla! CMS Development
+1

Please change it.

It is just going to end up being one of those never ending "Why did
you...?" questions and we have enough of those, thank you very much,
already.

JSQL is short. Or, JDatabaseQuery or JDBQuery or anything except
JQuery, IMO.

It's also a good way to show support and respect for the good work the
jQuery folks are doing.

Thanks Beat for raising the topic.

Ian MacLennan

unread,
Dec 21, 2009, 11:18:15 AM12/21/09
to joomla-...@googlegroups.com
JDatabaseQuery isn't bad.  Worth considering.  JSQL I don't like because it may not always be used for generating SQL (IIUC thoughts about MongoDB).

It is a real shame that there is this unfortunate naming collision.  JQuery is the most intuitive if we could move to an alternative world where jQuery doesn't exist.

Ian

Robert

unread,
Dec 21, 2009, 11:40:45 AM12/21/09
to Joomla! CMS Development
1+

I vote for renaming, JDatabaseQuery is fine

Robert

Ryan Briscall

unread,
Dec 21, 2009, 12:34:54 PM12/21/09
to joomla-...@googlegroups.com
Well, I'm not too concerned about the newbies that could get confused between the two.  We've been dealing with people on the "javascript vs. java" train for a while now.  Anyone who is confused between the two, you should not need to worry about. 

However, with regards to avoiding conflicts in online (searchable(google?)) documentation, I suggest JQuery be renamed to something else, yes.


G. D. Speer

unread,
Dec 21, 2009, 1:18:48 PM12/21/09
to Joomla! CMS Development
+1 -
I like shorter - JDBQuery or JDataQuery only from a saved keystrokes
perspective
but JDatabaseQuery works just as well.

Huge benefit for our users to be able to query the forums and wiki and
return
a substantially higher percentage of hits that are on topic. (not to mention
threads in this list archive)

> --
>
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>
>


--------------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.430 / Virus Database: 270.14.116/2579 - Release Date: 12/21/09
07:36:00

Andrew Eddie

unread,
Dec 21, 2009, 4:21:25 PM12/21/09
to joomla-...@googlegroups.com
Hi Beat.

The only compelling argument I can see is the ability for Joomla
people to find information cleanly about that particular class, and I
can get behind that if that's the consensus.

Currently a Google search for JSQL yields 106K results. JSql is used
by the Java community (not that I'm worried about that particularly)
and a few other variants are present, we'd out-rank that in a few
days. Most references seem to be old or dead.

WIth context "joomla jsql" has less than 1K results which is quite acceptable.

jquery, by comparison, yields 13+K results and even "joomla jquery" is
over 1.3M which is not trivial.

JDBQuery yields less that 1K results but again is used in Java.

JDatabaseQuery only ranks because we are talking about it ;), but
that's a lot of typing and my fingers aren't getting any younger :P

If it's to change, my preference is for JSQL because it's short and to
the point. I don't mind MongoDB having to be the exception. At the
end of the day it's going to have to translate SQL queries anyway and
in the core at least, JSQL would be used in the SQL building context.

JSQL +1

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/21 Beat <bea...@gmail.com>:

Joseph LeBlanc

unread,
Dec 21, 2009, 5:32:20 PM12/21/09
to joomla-...@googlegroups.com
This is my thought as well. Even though you wouldn't be feeding MongoDB an SQL query, you're still essentially constructing one via functions.

JSQL +1

...but if we want be more generic for the non-SQL DBs:

JDBQuery +1

-Joe

joomlagate.com

unread,
Dec 21, 2009, 7:16:09 PM12/21/09
to joomla-...@googlegroups.com
Hi, all,

Agree to change the name to JSql to avoid misunderstanding.

Thanks.

Joomlagate

http://www.joomlagate.com/


dan1dyoung

unread,
Dec 21, 2009, 8:23:47 PM12/21/09
to Joomla! CMS Development
Just to add another choice:)

What about "JomQuery" although close to "DomQuery"??

Dan

Andrew Eddie

unread,
Dec 21, 2009, 9:15:46 PM12/21/09
to joomla-...@googlegroups.com
Hi Dan.

That would break the existing naming conventions.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/22 dan1dyoung <dan...@dysolutions.co.uk>:

ndee

unread,
Dec 22, 2009, 2:15:16 AM12/22/09
to Joomla! CMS Development
Hi Beat,

agree, I already got confused an thought for one moment that JQuery is
related to jQuery js lib.

On 21 Dez., 11:38, Beat <beat...@gmail.com> wrote:
> I suggest once more to rename Joomla's database class "JQuery" to
> "JSql" to avoid further confusion.
>
> I exposed my arguments in several posts here:http://forum.joomla.org/viewtopic.php?p=1971648#p1971648
>
> and already pointed to the trademark confusion and suggested it a

> first time 18 months ago here:http://forum.joomla.org/viewtopic.php?f=326&t=195747&p=1294048&hilit=...

Nabyl

unread,
Dec 22, 2009, 4:16:07 AM12/22/09
to joomla-...@googlegroups.com
+1
And i propose another name :) JSqlQuery sounds to be a good name also.

2009/12/22 ndee <andy....@gmail.com>
--

You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.





--

_________________________________
Nabyl

dukeofgaming

unread,
Dec 22, 2009, 9:24:56 AM12/22/09
to joomla-...@googlegroups.com
...but, Joomla would get more hits! =P

+1 

And +1 to JDBQuery (I guess we are safe from the java folk, te-he). JSQLQuery sounds nice too but as Ian said, it may not always be for SQL.

Andrew Eddie

unread,
Dec 22, 2009, 4:14:14 PM12/22/09
to joomla-...@googlegroups.com
If it's not for SQL then you create a new class, JLisp, JMongoLanguage
or whatever that can also be passed into $db->setQuery();

Not a big deal.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/23 dukeofgaming <dukeof...@gmail.com>:

Ian MacLennan

unread,
Dec 22, 2009, 4:19:23 PM12/22/09
to joomla-...@googlegroups.com
I'm fine with JSql if that is what people want.  *shrug*

JQuery does fit much better with what it is though.

Ian

Andrew Eddie

unread,
Dec 22, 2009, 4:22:53 PM12/22/09
to joomla-...@googlegroups.com
Yep, my preference is actually not to change :) but I understand why
it's probably better to do so.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer

2009/12/23 Ian MacLennan <ian.ma...@joomla.org>:

Christophe Demko

unread,
Dec 23, 2009, 12:11:29 AM12/23/09
to Joomla! CMS Development
In the actual architecture, we can change the name of the class JQuery
to something else (I prefer the JDBQuery name) but there is a mistake
with the __toString function.
If we want to use several sql dabatases or even some no-sql databases
(mongodb, couchdb, ...). It's not to JQuery to decide the string
representation of its elements but to the database class handler
(mysql, oracle, mongodb, ...).

So we have to remove the magic __toString function of JQuery and
create an
abstract public function queryToString($jquery); in the JDatabase
class

which has to be overriden in JDataBase sub classes.

The setQuery function could become:
public function setQuery($sql, $offset = 0, $limit = 0,
$prefix='#__')
{
if ($sql instanceof JQuery) $sql= $this->queryToString($sql);
$this->_sql = $this->replacePrefix((string)$sql, $prefix);
$this->_limit = (int) $limit;
$this->_offset = (int) $offset;
}

All calls to $db->setQuery((string)$query) have to be replaced by $db-
>setQuery($query)

Of course, some getters have to be implemented in the JQuery class:

getType, getDelete, getSelect, ...

Ch.D

On 22 déc, 22:14, Andrew Eddie <mambob...@gmail.com> wrote:
> If it's not for SQL then you create a new class, JLisp, JMongoLanguage
> or whatever that can also be passed into $db->setQuery();
>
> Not a big deal.
>
> Regards,

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/12/23 dukeofgaming <dukeofgam...@gmail.com>:


>
> > ...but, Joomla would get more hits! =P
> > +1
> > And +1 to JDBQuery (I guess we are safe from the java folk, te-he).
> > JSQLQuery sounds nice too but as Ian said, it may not always be for SQL.
>

> > On Tue, Dec 22, 2009 at 3:16 AM, Nabyl <n.beerk...@gmail.com> wrote:
>
> >> +1
> >> And i propose another name :) JSqlQuery sounds to be a good name also.
>

> >> 2009/12/22 ndee <andy.ta...@gmail.com>

Andrew Eddie

unread,
Dec 23, 2009, 1:02:53 AM12/23/09
to joomla-...@googlegroups.com
Yeah, that is a good point Christophe. What you actually want to do
in the JDatabase class is have

$query = $db->getQuery();
$query->...

Sooooo, in that case, the class is probably something like JQueryMySQL.

The MongoDB driver would return JQueryMongoDB.

So, that's probably worth some thought as well if we are serious about
future-proofing this.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/23 Christophe Demko <chd...@gmail.com>:

Christophe Demko

unread,
Dec 23, 2009, 1:25:15 AM12/23/09
to Joomla! CMS Development
Hi Andrew, your approach (getQuery method) for this issue is better
than mine (queryToString method)

In your case, we can keep the magic __toString method which is better.

Ch.D

On 23 déc, 07:02, Andrew Eddie <mambob...@gmail.com> wrote:
> Yeah, that is a good point Christophe.  What you actually want to do
> in the JDatabase class is have
>
> $query = $db->getQuery();
> $query->...
>
> Sooooo, in that case, the class is probably something like JQueryMySQL.
>
> The MongoDB driver would return JQueryMongoDB.
>
> So, that's probably worth some thought as well if we are serious about
> future-proofing this.
>
> Regards,

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>

> 2009/12/23 Christophe Demko <chde...@gmail.com>:

> >> Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer

Steven Pignataro

unread,
Dec 23, 2009, 3:06:33 PM12/23/09
to Joomla! CMS Development
+1 as well - someone did some quick research.

On Dec 21, 4:21 pm, Andrew Eddie <mambob...@gmail.com> wrote:
> Hi Beat.
>
> The only compelling argument I can see is the ability for Joomla
> people to find information cleanly about that particular class, and I
> can get behind that if that's the consensus.
>
> Currently a Google search for JSQL yields 106K results.  JSql is used
> by the Java community (not that I'm worried about that particularly)
> and a few other variants are present, we'd out-rank that in a few
> days.  Most references seem to be old or dead.
>
> WIth context "joomla jsql" has less than 1K results which is quite acceptable.
>
> jquery, by comparison, yields 13+K results and even "joomla jquery" is
> over 1.3M which is not trivial.
>
> JDBQuery yields less that 1K results but again is used in Java.
>
> JDatabaseQuery only ranks because we are talking about it ;), but
> that's a lot of typing and my fingers aren't getting any younger :P
>
> If it's to change, my preference is for JSQL because it's short and to
> the point.  I don't mind MongoDB having to be the exception. At the
> end of the day it's going to have to translate SQL queries anyway and
> in the core at least, JSQL would be used in the SQL building context.
>
> JSQL +1
>
> Regards,

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/12/21 Beat <beat...@gmail.com>:


>
> > I suggest once more to rename Joomla's database class "JQuery" to
> > "JSql" to avoid further confusion.
>
> > I exposed my arguments in several posts here:
> >http://forum.joomla.org/viewtopic.php?p=1971648#p1971648
>
> > and already pointed to the trademark confusion and suggested it a
> > first time 18 months ago here:

> >http://forum.joomla.org/viewtopic.php?f=326&t=195747&p=1294048&hilit=...

Mitch Pirtle

unread,
Dec 23, 2009, 3:18:48 PM12/23/09
to joomla-...@googlegroups.com
On Wed, Dec 23, 2009 at 1:02 AM, Andrew Eddie <mamb...@gmail.com> wrote:
> Yeah, that is a good point Christophe.  What you actually want to do
> in the JDatabase class is have
>
> $query = $db->getQuery();
> $query->...
>
> Sooooo, in that case, the class is probably something like JQueryMySQL.
>
> The MongoDB driver would return JQueryMongoDB.
>
> So, that's probably worth some thought as well if we are serious about
> future-proofing this.

If we're going to bother with making a name change, then we should be
absolute in the new name being correct - and SQL is most definitely
not correct, as MongoDB is only one of many databases that doesn't do
SQL. This also paves the way for REST interfaces for storage (and not
just CouchDB either) and object databases like Project Voldemort and
memcachedb.

JDBQuery or JDatabaseQuery are certainly more logical and accurate
alternatives to JQuery, IMHO.

-- Mitch

Andrew Eddie

unread,
Dec 23, 2009, 6:13:11 PM12/23/09
to joomla-...@googlegroups.com
Mitch, since your the odd man out who is causing all the naming pain
:P can you give us a few examples of non-SQL queries.

Thanks.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/24 Mitch Pirtle <mitch....@gmail.com>:

Mitch Pirtle

unread,
Dec 24, 2009, 12:47:04 AM12/24/09
to joomla-...@googlegroups.com
On Wed, Dec 23, 2009 at 6:13 PM, Andrew Eddie <mamb...@gmail.com> wrote:
> Mitch, since your the odd man out who is causing all the naming pain
> :P can you give us a few examples of non-SQL queries.

First off, there's a LOT of activity in this space, here's wikipedia's
great entry on just document databases (like MongoDB):

http://en.wikipedia.org/wiki/Document-oriented_database

There are also more traditional key-value stores like MemcacheDB,
Project Voldemort, BigTable...

// MongoDB
See http://www.php.net/manual/en/mongo.tutorial.php
// first, presume we have a collection called "posts", collections are
like tables
$collection = $db->posts;
// to find a blog post titled "first post"
$cursor = $collection->findOne(array("title" => "first post"));
// to get a count of published posts in the category"Australia"
$args = array( "published" => "1", "category" => "Australia");
$count = $collection->find($args);
// Use the same query to get a list (like an objectList)
$cursor = $collection->find($args)
while( $cursor->hasNext() ) {
var_dump( $cursor->getNext() );
}

// CouchDB, HBase
You would have to use REST for these from PHP
E.g. for CouchDB you would create a view, the default URL structure is:
/database/_design/designdocname/_view/viewname

// Redis - I know only how to access by ID
$post = $db->get_by_id( $id );
http://www.ohloh.net/p/php-redis

// Apache Jackrabbit - use Jackalope and Zend java/php bridge
https://fosswiki.liip.ch/display/jackalope/Home
(documentation for PHP incomplete)

Chances are most will either provide a php extension (like MongoDB) or
have a RESTful interface. Either way, you have nothing such as SQL
going on.

Making it possible for us to go this route means you could essentially
hook Joomla into anything, regardless of platform or access methods.
This would be absolutely AWESOME as the impact would be profound. If
we're going to take the time to break independence on MySQL, might as
well go all the way and do it right the first time :-)

-- Mitch

Andrew Eddie

unread,
Dec 24, 2009, 1:07:53 AM12/24/09
to joomla-...@googlegroups.com
Ok, I think we are confused with the end-goal.

There are two options as I see it:

A) Write queries in native SQL using a query builder class. Oracle,
MSSQL, MongoDB and co translates this into native calls suitable in
conjunction with the driver itself.

This is by far the easiest to implement now and what Christophe and I
have proposed is that you need to return a native query builder object
based on the driver from the JDatabase class. This method *may*
support Joomla running on any database platform but does allow it to
connect to other platforms.

B) Write queries in an abstract query builder that get translated into
SQL or another query language.

This is by far the most complex and intensive because nothing has been
done and has the biggest impact on 3PD's. However, this method does
allow for Joomla to be supported (potentially) on any database
platform.

The question has really turned from "rename JQuery" to "what is the
required architecture, then worry about class names". So, to that
end, what's the architecture we need to allow or option A and possibly
go towards supporting a bit of option B?

Everyone follow what I'm saying?

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/24 Mitch Pirtle <mitch....@gmail.com>:

Christophe Demko

unread,
Dec 24, 2009, 5:31:54 AM12/24/09
to Joomla! CMS Development
For J!1.6, I suggest only the renaming of JQuery to J(DB|Database|SQL)
Query (it's urgent to have a beta out and since the svn database
branch will not be ready for 1.6)
* put a warning tag on some JDatabase methods (getQuery, setQuery...)
(there will be different in J!1.7)

For J!1.7, I suggest the A) approach:

* have a J(DB|Database|SQL)Query generic class for constructing an
*sql* query.
* have a &getQuery() method in each subclass of JDatabase (actually
JDatabaseMyql and JDatabaseMysqli). This method should return an
unique instance of a subclass of J(DB|Database|SQL)Query (i.e. J(DB|
Database|SQL)QueryMysql for mysql)
* have a reset method in J(DB|Database|SQL)Query for reseting the
query
* have a specialized subclass of J(DB|Database|SQL)Query and J(DB|
Database|SQL)QueryElement in each file located in librairies/joomla/
database/database/*.php
* have a __toString method in each subclass of J(DB|Database|SQL)Query

The classical case would be
$query = &$db->getQuery(); // Get a specialized query (according to
the db handler)
$query->reset(); // Reset the query object
$query->select('*');
$query->from('#__content');
$object = $db->loadObjectList(); // No need to call setQuery since the
query object is unique to the db handler

The cast (string)$query would be done in the query() method of the
JDatabase subclasses

For J!2.0, I suggest the B) approach (a lot of work has to be done)

Ch.D

On 24 déc, 07:07, Andrew Eddie <mambob...@gmail.com> wrote:
> Ok, I think we are confused with the end-goal.
>
> There are two options as I see it:
>
> A) Write queries in native SQL using a query builder class.  Oracle,
> MSSQL, MongoDB and co translates this into native calls suitable in
> conjunction with the driver itself.
>
> This is by far the easiest to implement now and what Christophe and I
> have proposed is that you need to return a native query builder object
> based on the driver from the JDatabase class.  This method *may*
> support Joomla running on any database platform but does allow it to
> connect to other platforms.
>
> B) Write queries in an abstract query builder that get translated into
> SQL or another query language.
>
> This is by far the most complex and intensive because nothing has been
> done and has the biggest impact on 3PD's.  However, this method does
> allow for Joomla to be supported (potentially) on any database
> platform.
>
> The question has really turned from "rename JQuery" to "what is the
> required architecture, then worry about class names".  So, to that
> end, what's the architecture we need to allow or option A and possibly
> go towards supporting a bit of option B?
>
> Everyone follow what I'm saying?
>
> Regards,

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/12/24 Mitch Pirtle <mitch.pir...@gmail.com>:


>
> > On Wed, Dec 23, 2009 at 6:13 PM, Andrew Eddie <mambob...@gmail.com> wrote:
> >> Mitch, since your the odd man out who is causing all the naming pain
> >> :P can you give us a few examples of non-SQL queries.
>
> > First off, there's a LOT of activity in this space, here's wikipedia's
> > great entry on just document databases (like MongoDB):
>
> >http://en.wikipedia.org/wiki/Document-oriented_database
>
> > There are also more traditional key-value stores like MemcacheDB,
> > Project Voldemort, BigTable...
>
> > // MongoDB

> > Seehttp://www.php.net/manual/en/mongo.tutorial.php

Mitch Pirtle

unread,
Dec 24, 2009, 9:18:12 AM12/24/09
to joomla-...@googlegroups.com
On Thu, Dec 24, 2009 at 1:07 AM, Andrew Eddie <mamb...@gmail.com> wrote:
> The question has really turned from "rename JQuery" to "what is the
> required architecture, then worry about class names".  So, to that
> end, what's the architecture we need to allow or option A and possibly
> go towards supporting a bit of option B?

AFAIAC these options are the same, so if it makes folks happy I'm all
for option number one :-)

I think it's a great idea to have a native query builder based on the
driver of the database class.

I'm just saying that if we're going to rename the JQuery class, we
might as well make sure we don't have to rename it again in 12 months.
(Hence the aversion to the word SQL.)

-- Mitch

Stian Didriksen

unread,
Dec 24, 2009, 5:29:35 PM12/24/09
to Joomla! CMS Development
The query class should be able to work with any of the database
adapters, or else there's not much use for the adapters if they're not
making things abstract.
I think Gergos suggestion on using JDatabaseQuery (something I also
suggested long ago on AllTogetherAsAWhole) is the most sensible ones.

If you need short names, isn't $this->getQuery(), or JFactory::getDbo
()->getQuery() short enough?
Anyone can see what a JDatabaseQuery class is supposed to do in an
instant.
Don't have these silly names like JDBQuery, JSql, JSQLQuery.

It's an subclass used by JDatabase, so if you think about that, it's
natural to expect the name to be JDatabaseQuery, not some other crazy
stuff ;)

The whole problem is the name being confusing. So it should be a
sensible name that isn't so short you scratch your head when you read
it.

On Dec 23, 7:02 am, Andrew Eddie <mambob...@gmail.com> wrote:
> Yeah, that is a good point Christophe.  What you actually want to do
> in the JDatabase class is have
>
> $query = $db->getQuery();
> $query->...
>
> Sooooo, in that case, the class is probably something like JQueryMySQL.
>
> The MongoDB driver would return JQueryMongoDB.
>
> So, that's probably worth some thought as well if we are serious about
> future-proofing this.
>
> Regards,

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>

> 2009/12/23 Christophe Demko <chde...@gmail.com>:> In the actual architecture, we can change the name of the class JQuery

> >> Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer

ErikThe3rd

unread,
Dec 25, 2009, 12:58:03 AM12/25/09
to Joomla! CMS Development
My 2cents: I opt for JDatabaseQuery. Stian gave a good explanation
on that.

Erik

> > >> Andrew Eddiehttp://www.theartofjoomla.com-theart of becoming a Joomla developer

Andrew Eddie

unread,
Dec 25, 2009, 4:08:40 PM12/25/09
to joomla-...@googlegroups.com
Thanks Mitch.

So you are saying that the API for the current JQuery is something you
can use for MongoDB if it's able to roll it's own query class?

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2009/12/25 Mitch Pirtle <mitch....@gmail.com>:

Hannes Papenberg

unread,
Dec 26, 2009, 12:11:47 PM12/26/09
to joomla-...@googlegroups.com
I agree with Erik and Stian here. Make it JDatabaseQuery and be done
with it. Also, I don't think that we have to cater for every DB system
out there. Joomla is a system based on SQL and specifically on MySQL and
I think its cool to have database classes that can connect Joomla to
systems like MongoDB, but I doubt that it will ever run natively on a
non-SQL based system. It already starts with the database-scheme. Stuff
that we save in more than one table could potentially be saved in just
one object in Mongo, so its not really trivial to get this seperated in
our own code. I think it would be enough to create a query-builder that
provides SQL-specific functions and if we create query-builder for other
systems, these can have a completely different function-set than the
SQL-builder.

Last but not least, please remember that we already have a function
getQuery() in JDatabase, which returns the current query. Maybe we
should name it newQuery()?

Hannes

Stian Didriksen

unread,
Dec 26, 2009, 12:20:10 PM12/26/09
to Joomla! CMS Development
Hi Hannes,

I think as long as it gets the current query, it should be named
getQuery(), as that's what it's doing.
For creating new queries, I think the most OOP way of doing it would
be a setQuery() method, where it'll create a new one if you don't pass
any parameters to it.
So that you could do something like this to create a new and empty
query instance:
$query = $this->setQuery()->getQuery();

To me that feels more OOP :)

> >>>>> Andrew Eddiehttp://www.theartofjoomla.com-theartof becoming a Joomla developer

Hannes Papenberg

unread,
Dec 26, 2009, 12:28:57 PM12/26/09
to joomla-...@googlegroups.com
I think we wanted a function that returns a new JDatabaseQuery<DBMS>
object, which in my book would be JDatabase::newQuery(). getQuery()
would still return the current query set by JDatabase::setQuery()

Hannes

Mitch Pirtle

unread,
Dec 26, 2009, 2:29:02 PM12/26/09
to joomla-...@googlegroups.com
On Fri, Dec 25, 2009 at 4:08 PM, Andrew Eddie <mamb...@gmail.com> wrote:
> Thanks Mitch.
>
> So you are saying that the API for the current JQuery is something you
> can use for MongoDB if it's able to roll it's own query class?

Yup. Note however that takes nothing into account for the core
functionality, which still is inherently tied to relational theory
(joins abound)... So this IMHO is only the first step, but a HUGE one
that puts Joomla in a great position to take advantage of emerging
technologies; and therefore be a viable option for more people.

I think for 1.6 the most we can do is provide multiple named database
connections, and provide a query builder class (my vote is
JDatabaseQuery) that I can offer a MongoDB driver for. That way Joomla
can run in a traditional environment, and also provide support for
those who want to bolt in more modern tech under the hood.

Long term is the issue of relational databases needing joins and SQL,
whereas none of the others do. That's going to be a really fun one to
figure out!

-- Mitch

Stian Didriksen

unread,
Dec 27, 2009, 2:21:58 PM12/27/09
to Joomla! CMS Development
In any case the factory pattern is to use getX when fetching
something.
If you don't want to get the current query, you don't need an separate
function for getting a new query.

$newQuery = new $this->getQuery();

PHP is pretty cool that way, when it comes to OOP ;)

> >>>>>>> Andrew Eddiehttp://www.theartofjoomla.com-theartofbecoming a Joomla developer

Andrew Eddie

unread,
Dec 27, 2009, 11:57:16 PM12/27/09
to joomla-...@googlegroups.com
Ok, let's try and wrap it up for what we do in 1.6.

It would seem the best arguments are to rename JQuery to
JDatabaseQuery and it would seem that the API for this class is
sufficient for the non-SQL-specific engines. In short, there is one
query class to rule them all. If there is only one class, we don't
need to worry about changing the getQuery method at all. The only
limitation to this is you can never have a database engine named
'Query'.

Non-SQL (and non-MySQL) engines can override JDatabase::setQuery to
perform custom parsing of query strings and objects.

That keeps everything pretty simple.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer

Christophe Demko

unread,
Dec 28, 2009, 6:09:21 AM12/28/09
to Joomla! CMS Development
Ok, but the getQuery method should return the data passed in argument
to setQuery.
Actually, it return the string representation of this data.

I suggest to delay the call to replacePrefix later in the code (when
the query is performed)


public function setQuery($sql, $offset = 0, $limit = 0,
$prefix='#__')
{

$this->_sql = $this->replacePrefix((string)$sql, $prefix); // To be
replaced by $this->_sql = $sql
// add $this->_prefix = $prefix;

$this->_limit = (int) $limit;
$this->_offset = (int) $offset;

return $this;
}

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer

Andrew Eddie

unread,
Dec 28, 2009, 2:52:49 PM12/28/09
to joomla-...@googlegroups.com
Yeah, you could to that. All it means is moving the prefix handling
to the query class rather than JDatabase doing it. But I think that
might introduce complications for this round. It's something we could
add in a later version.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer

2009/12/28 Christophe Demko <chd...@gmail.com>:

Beat

unread,
Jan 13, 2010, 6:30:37 PM1/13/10
to Joomla! CMS Development
Hi Andrew,

From what I understand, it seems that consensus is here to rename.

Any news on this renaming commit into svn before beta ? ;-)

Best Regards,
Beat
http://www.joomlapolis.com/

> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer

Andrew Eddie

unread,
Jan 13, 2010, 6:41:00 PM1/13/10
to joomla-...@googlegroups.com
Short answer is we'll go with JDatabaseQuery.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2010/1/14 Beat <bea...@gmail.com>:

Andrew Eddie

unread,
Feb 4, 2010, 4:37:50 PM2/4/10
to joomla-...@googlegroups.com
On 14 January 2010 09:41, Andrew Eddie <mamb...@gmail.com> wrote:
>
> Short answer is we'll go with JDatabaseQuery.

And that's now done.

Reply all
Reply to author
Forward
0 new messages