You are here: Re: Objects and Arrays « PHP Programming Language « IT news, forums, messages
Re: Objects and Arrays

Posted by Jerry Stuckle on 04/03/07 04:46

Simon Stienen wrote:
> On 2007-04-03 05-51-52, Jerry Stuckle wrote:
>> No, the DB object represents a QUERY.
>
> a) Why isn't the query represented by a QUERY object?

Because it's called a db object. Maybe my description was confusing.
The query need not be a SELECT. It could be an INSERT, CREATE TABLE or
anything else.

> b) It's definitely NOT true that an object represents something and then
> something else (even if of the same type). The OOP approach would be to
> have a QUERY object represent a query and build a new query object for a
> new query. Additionally, it's bollocks to use a single query object
> throughout the whole application for several queries. Especially if this
> query object is called DB.
>

I didn't say that. I said that an object represents one thing at a
time. Your OOP approach is one way. This is another - and is just as
valid.

> Next: A result is not a query but the result of a single invocation of this
> query, therefore regardless how you call your query object, it's still
> stupid to store the result in the same object. It should be returned as a
> new instance of a result type - just as I mentioned several posts before.
>

In you opinion. Millions of developers disagree with you. It's just a
different way of doing things.

> Third: Taking C++ as an example: MySQL++ is doing exactly that. There is
> mysqlpp::Query (not mysql::DB! - to all the onlookers not familiar with
> C++: In C++ the scope operator :: is also used to seperate namespaces from
> type names within them - just take the whole "mysqlpp::*" as typename to
> use with new) which has a few methods to execute the query which will then
> return a mysqlpp::Result instance. Just as I said. It's all in
> understanding the purpose of the object.

Yep, and there are also C++ classes which work exactly the way the db
class in this program works. Different ways of doing things.

Just because it doesn't work the way you want it to work doesn't mean
it's wrong. It's a different way of looking at database communications,
and is just as valid as the way you're familiar with.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация