[thelist] php design question
rudy
r937 at interlog.com
Mon Nov 18 20:35:01 CST 2002
> Objects are /different/ than includes.
i shall take that on pure faith for the time being
> Every time you include something, it will run. Every time. The
> whole code.
>
> With an object, it runs only when you ask it to run. It only
> "exists" once, and you just reference back to it.
if i ask it to run, it runs? and i would not ask it to run if i didn't want
it to?
and assuming i don't include something if i don't need it -- i mean,
why would i? that'd be just as silly -- then so as far as "running" goes,
there's no difference?
> An include "exists" as many times as you include it.
i would include an include only once on each page though
to me, an include does something, like runs the SELECT statement
to get the menu items out of the database
i would only do that once on each page, and even then, with query
caching, it might not really run!! (can objects do that?)
or an include is a snippet of code, like the footer text, which i have
a hard time seeing why i would want more than once per page...
> Imagine there's a beach ball in your house. That's an object.
When
> you want to bean somebody in the face with it, you just pick up the beach
> ball and throw it.
martinis, cars and tires, bean a beach ball in your baby's face...
i still don't get it
> You don't make a _new_ beach ball every time you want to throw it
> at somebody. That would be an include.
thanks for trying, but could you relate that to html, divs, web pages, and
includes (which i take to be portions of web pages, or portions of the
scripts
that generate web pages) -- like, a nav bar at the top of each page
isn't each web page a new page? and you're saying if i want to pick up
that beach ball and serve it to your browser, that's an include?
or, if it's an object, and it exists only once, how do i send it to your
browser?
or are you saying every web page in my web site is written with
encapsulated objects that i just have to use the right method of?
$webpage --> thiswebpage.code()
well, that may look neat, but it's still smoke & mirrors to me
;o)
rudy
More information about the thelist
mailing list