need a pointer on OOP with php | | |
Hello there,
i am getting to need to make my web stuff more OO.
i have a project at work that we are porting to the internet, and i
started learning php to do so.
the project is now mamoth is size, and code is reused and pasted all
over it. I plan to do a good re-write using better, and cleaner code.
So i want to incorporate some classes.
So i have some questions.
i am writing in eclipse and phpedit on linux.
i wrote a simple class ( by example in a book )
it goes a little something like this:
class Customer
{
var $name;
function get_name()
{
return $this-name;
}
function set_name($new_name)
{
$this-name = $new_name;
}
}
my parser complains about field declarations not being declared public,
private, or protected .
what is this talking about ?
another question....
if i create a customer object when say, someone logs into the site. Can
i pass that object to each page in session variables ? like from the
login page, can the user move about the site without me coding the
declarations over and over ?
or is there a better way to go about this ?
still a newbie here.
thanks. | | | | re: need a pointer on OOP with php
nephish wrote: Quote:
Hello there,
>
i am getting to need to make my web stuff more OO.
i have a project at work that we are porting to the internet, and i
started learning php to do so.
the project is now mamoth is size, and code is reused and pasted all
over it. I plan to do a good re-write using better, and cleaner code.
So i want to incorporate some classes.
>
So i have some questions.
>
i am writing in eclipse and phpedit on linux.
i wrote a simple class ( by example in a book )
>
it goes a little something like this:
>
class Customer
{
var $name;
>
function get_name()
{
return $this-name;
>
}
function set_name($new_name)
{
$this-name = $new_name;
}
}
>
my parser complains about field declarations not being declared
public, private, or protected .
what is this talking about ?
1. If you're serious about OO, learn what they mean.
2. http://nl3.php.net/manual/en/languag...visibility.php It was
introduced in PHP in version 5, in 4 it will not work. From the manual:
"Note: The PHP 4 method of declaring a variable with the var keyword is no
longer valid for PHP 5 objects. For compatibility a variable declared in php
will be assumed with public visibility, and a E_STRICT warning will be
issued." Quote:
another question....
>
if i create a customer object when say, someone logs into the site.
Can i pass that object to each page in session variables ? like from
the login page, can the user move about the site without me coding the
declarations over and over ?
You can: http://nl3.php.net/manual/en/function.serialize.php http://nl3.php.net/manual/en/language.oop5.autoload.php
You might want to ask yourself wether this is really needed, and why exactly
some simple variables aren't enough. Quote:
or is there a better way to go about this ?
Just keep in mind OO isn't neccesarily better, and www.php.net is a great
source where you would have found answers to this questions very quickly. Be
sure to read the user contributed notes.
Grtz,
--
Rik Wasmus | | | | re: need a pointer on OOP with php
First off, thanks for the links and the info, especially the first
link.
Thats what i needed to know.
The system at work uses php4, the system i use at home has php5.
well, suppose i could upgrade works server, but still, passing
everything around as a stream may be a bit more complicated than i
wanted to, but still may be worth it.
i do appreciate the info. Though, i know more about what i am dealing
with.
shawn
Rik wrote: Quote:
nephish wrote: Quote:
Hello there,
i am getting to need to make my web stuff more OO.
i have a project at work that we are porting to the internet, and i
started learning php to do so.
the project is now mamoth is size, and code is reused and pasted all
over it. I plan to do a good re-write using better, and cleaner code.
So i want to incorporate some classes.
So i have some questions.
i am writing in eclipse and phpedit on linux.
i wrote a simple class ( by example in a book )
it goes a little something like this:
class Customer
{
var $name;
function get_name()
{
return $this-name;
}
function set_name($new_name)
{
$this-name = $new_name;
}
}
my parser complains about field declarations not being declared
public, private, or protected .
what is this talking about ?
>
1. If you're serious about OO, learn what they mean.
2. http://nl3.php.net/manual/en/languag...visibility.php It was
introduced in PHP in version 5, in 4 it will not work. From the manual:
"Note: The PHP 4 method of declaring a variable with the var keyword is no
longer valid for PHP 5 objects. For compatibility a variable declared in php
will be assumed with public visibility, and a E_STRICT warning will be
issued."
> Quote:
another question....
if i create a customer object when say, someone logs into the site.
Can i pass that object to each page in session variables ? like from
the login page, can the user move about the site without me coding the
declarations over and over ?
>
You can: http://nl3.php.net/manual/en/function.serialize.php http://nl3.php.net/manual/en/language.oop5.autoload.php
>
You might want to ask yourself wether this is really needed, and why exactly
some simple variables aren't enough.
> Quote:
or is there a better way to go about this ?
>
Just keep in mind OO isn't neccesarily better, and www.php.net is a great
source where you would have found answers to this questions very quickly. Be
sure to read the user contributed notes.
>
Grtz,
--
Rik Wasmus
| | | | re: need a pointer on OOP with php
"Rik" <luiheidsgoeroe@hotmail.comwrote in message
news:b04a6$44d63819$8259c69c$7780@news1.tudelft.nl ... Quote:
nephish wrote: Quote:
>Hello there,
>>
>i am getting to need to make my web stuff more OO.
>i have a project at work that we are porting to the internet, and i
>started learning php to do so.
>the project is now mamoth is size, and code is reused and pasted all
>over it. I plan to do a good re-write using better, and cleaner code.
>So i want to incorporate some classes.
>>
>So i have some questions.
>>
>i am writing in eclipse and phpedit on linux.
>i wrote a simple class ( by example in a book )
>>
>it goes a little something like this:
>>
>class Customer
> {
> var $name;
>>
> function get_name()
> {
> return $this-name;
>>
> }
> function set_name($new_name)
> {
> $this-name = $new_name;
> }
> }
>>
>my parser complains about field declarations not being declared
>public, private, or protected .
>what is this talking about ?
>
1. If you're serious about OO, learn what they mean.
2. http://nl3.php.net/manual/en/languag...visibility.php It was
introduced in PHP in version 5, in 4 it will not work. From the manual:
"Note: The PHP 4 method of declaring a variable with the var keyword is no
longer valid for PHP 5 objects. For compatibility a variable declared in
php
will be assumed with public visibility, and a E_STRICT warning will be
issued."
This behaviour has been recently changed so that the use of the "var"
keyword does NOT trigger an E_STRICT warning in PHP 5
I have written software that uses PHP's OO capabilities in PHP 4, and it
runs perfectly well in PHP 5. Samples of my code are available from the
websites which appear in my signature.
--
Tony Marston http://www.tonymarston.net http://www.radicore.org | | | | re: need a pointer on OOP with php
Tony Marston wrote: Quote: Quote: Quote:
>>my parser complains about field declarations not being declared
>>public, private, or protected .
>>what is this talking about ?
>>
>1. If you're serious about OO, learn what they mean.
>2. http://nl3.php.net/manual/en/languag...visibility.php It was
>introduced in PHP in version 5, in 4 it will not work. From the
>manual: "Note: The PHP 4 method of declaring a variable with the var
>keyword is no longer valid for PHP 5 objects. For compatibility a
>variable declared in php
>will be assumed with public visibility, and a E_STRICT warning will
>be issued."
>
This behaviour has been recently changed so that the use of the "var"
keyword does NOT trigger an E_STRICT warning in PHP 5
Any idea which version they changed this? Quote:
I have written software that uses PHP's OO capabilities in PHP 4, and
it runs perfectly well in PHP 5. Samples of my code are available
from the websites which appear in my signature.
Yup, my own PHP 5 version works perfectly with my previous PHP 4 code.
Grtz,
--
Rik Wasmus | | | | re: need a pointer on OOP with php
nephish wrote: Quote:
if i create a customer object when say, someone logs into the site. Can
i pass that object to each page in session variables ? like from the
login page, can the user move about the site without me coding the
declarations over and over ?
>
or is there a better way to go about this ?
Hi nephish,
Theoretically you store objects that should have the same lifetime or
shorter as the session in the session. Object that have a longer
lifetime, or have to be shared by multiple users you better store in in
a database. This is called 'persistency'. For more info on persistency
see http://www-128.ibm.com/developerwork...xw01DynamicPHP http://www.onlamp.com/pub/a/php/2005...erloading.html
The thread "PHP Dynamic Database Code" started by josh.kuo@gmail.com on
Fri, 9 Jun 2006 23:13:21 +0000 (UTC) (from which i have the above urls)
may also be interesting.
Saving objects in the session in practice has often brougt me troubles.
The point is you must have its class loaded before the session is
started. This may be easy if you have only one page and one object
class, but i usually have many of both. In my experience it is more
reliable to copy all the objects member variables (but not the ones that
hold objects) into an asspciative array and store the array in the
session. When you later need the object you copy the values from the
array back into a new object.
Furthermore you could take a look at patterns. An example of a pattern
for user interfacing can be found at: http://www.phppeanuts.org/site/index_php/Pagina/195
Many more patterns are at http://c2.com/cgi-bin/wiki?DesignPatterns
(if you get lost, try: http://c2.com/cgi-bin/wiki?search=controller )
Greetings,
Henk Verhoeven, www.phpPeanuts.org.
Some OO terms and definitions: http://www.phppeanuts.org/site/index...7/What+is.html
(contains interpretations specific to the phpPeanuts framework) | | | | re: need a pointer on OOP with php
Ok, well what i have been doing is creating session variables for
everything possible that relates to what one may call an object (not in
the code, but at the site)
like $name = $_SESSION['name'];
$email = $_SESSION['email'];
$phone = yadda, yadda, yadda
so, i suppose this is still the easier way to pull this off.
thanks for all the info, i am trying to learn as much as possible
because i want to redesign everything in the fall. i started learning
php about a year ago, and a whole lot of stuff i did last Fall, i would
do differently this Fall.
So i want to make it as streamlined as possible.
thanks for all your help
shawn
Henk Verhoeven wrote: Quote:
nephish wrote: Quote:
if i create a customer object when say, someone logs into the site. Can
i pass that object to each page in session variables ? like from the
login page, can the user move about the site without me coding the
declarations over and over ?
or is there a better way to go about this ?
>
Hi nephish,
>
Theoretically you store objects that should have the same lifetime or
shorter as the session in the session. Object that have a longer
lifetime, or have to be shared by multiple users you better store in in
a database. This is called 'persistency'. For more info on persistency
see http://www-128.ibm.com/developerwork...xw01DynamicPHP http://www.onlamp.com/pub/a/php/2005...erloading.html
The thread "PHP Dynamic Database Code" started by josh.kuo@gmail.com on
Fri, 9 Jun 2006 23:13:21 +0000 (UTC) (from which i have the above urls)
may also be interesting.
>
Saving objects in the session in practice has often brougt me troubles.
The point is you must have its class loaded before the session is
started. This may be easy if you have only one page and one object
class, but i usually have many of both. In my experience it is more
reliable to copy all the objects member variables (but not the ones that
hold objects) into an asspciative array and store the array in the
session. When you later need the object you copy the values from the
array back into a new object.
>
Furthermore you could take a look at patterns. An example of a pattern
for user interfacing can be found at: http://www.phppeanuts.org/site/index_php/Pagina/195
Many more patterns are at http://c2.com/cgi-bin/wiki?DesignPatterns
(if you get lost, try: http://c2.com/cgi-bin/wiki?search=controller )
>
Greetings,
>
Henk Verhoeven, www.phpPeanuts.org.
>
Some OO terms and definitions: http://www.phppeanuts.org/site/index...7/What+is.html
(contains interpretations specific to the phpPeanuts framework)
| | | | re: need a pointer on OOP with php
nephish wrote: Quote:
Ok, well what i have been doing is creating session variables for
everything possible that relates to what one may call an object (not in
the code, but at the site)
like $name = $_SESSION['name'];
$email = $_SESSION['email'];
$phone = yadda, yadda, yadda
>
so, i suppose this is still the easier way to pull this off.
thanks for all the info, i am trying to learn as much as possible
because i want to redesign everything in the fall. i started learning
php about a year ago, and a whole lot of stuff i did last Fall, i would
do differently this Fall.
So i want to make it as streamlined as possible.
>
thanks for all your help
>
shawn
>
>
How I typically do it (since I have my data in a database) is to store
the primary key to the entry in my $_SESSION object. Then I fetch
whatever I need from the database when I need it.
I find this to be much cleaner code. It also fetches current
information in the (admittedly unlikely) event the data is changed while
you're passing it around.
P.S. Please don't top post. This newsgroup uses bottom (or inline)
posting as the standard.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | | | | re: need a pointer on OOP with php
Jerry Stuckle wrote: Quote:
nephish wrote: Quote:
Ok, well what i have been doing is creating session variables for
everything possible that relates to what one may call an object (not in
the code, but at the site)
like $name = $_SESSION['name'];
$email = $_SESSION['email'];
$phone = yadda, yadda, yadda
so, i suppose this is still the easier way to pull this off.
thanks for all the info, i am trying to learn as much as possible
because i want to redesign everything in the fall. i started learning
php about a year ago, and a whole lot of stuff i did last Fall, i would
do differently this Fall.
So i want to make it as streamlined as possible.
thanks for all your help
shawn >
How I typically do it (since I have my data in a database) is to store
the primary key to the entry in my $_SESSION object. Then I fetch
whatever I need from the database when I need it.
>
I find this to be much cleaner code. It also fetches current
information in the (admittedly unlikely) event the data is changed while
you're passing it around.
>
P.S. Please don't top post. This newsgroup uses bottom (or inline)
posting as the standard.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================
by bottom post, you mean write my stuff at the bottom of the text entry
box ?
like this ? Sorry about that. I have kinda wondered which is better.
Anyway. I like that idea too. just storing the session variable of the
primary key.
in my case (user_id_number), and just using that to conquer everything
else.
OK, i have another question about this re-write i want to do. Please
understand, i started learning php about 10 months ago by building our
huge website with it. couple of hundered scripts now.
there is a lot i find on the web about MVC. But also found that it
seems to be best for simple CRUD. What we have here is a lot more
complex. We are pulling machine data, processing it, displaying graphs
of machine effeciency, history of machine performance, etc.. Once
things get complex like that, not like a blog site or something, does
an MVC still make sense ?
thanks.
sk | | | | re: need a pointer on OOP with php
nephish wrote: Quote:
Jerry Stuckle wrote:
> Quote:
>>nephish wrote:
>> Quote:
>>>Ok, well what i have been doing is creating session variables for
>>>everything possible that relates to what one may call an object (not in
>>>the code, but at the site)
>>>like $name = $_SESSION['name'];
>>>$email = $_SESSION['email'];
>>>$phone = yadda, yadda, yadda
>>>
>>>so, i suppose this is still the easier way to pull this off.
>>>thanks for all the info, i am trying to learn as much as possible
>>>because i want to redesign everything in the fall. i started learning
>>>php about a year ago, and a whole lot of stuff i did last Fall, i would
>>>do differently this Fall.
>>>So i want to make it as streamlined as possible.
>>>
>>>thanks for all your help
>>>
>>>shawn
>>>
>>>
>>
>>How I typically do it (since I have my data in a database) is to store
>>the primary key to the entry in my $_SESSION object. Then I fetch
>>whatever I need from the database when I need it.
>>
>>I find this to be much cleaner code. It also fetches current
>>information in the (admittedly unlikely) event the data is changed while
>>you're passing it around.
>>
>>P.S. Please don't top post. This newsgroup uses bottom (or inline)
>>posting as the standard.
>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>jstucklex@attglobal.net
>>==================
>
>
by bottom post, you mean write my stuff at the bottom of the text entry
box ?
like this ? Sorry about that. I have kinda wondered which is better.
>
Yep, or intermingled, like this. Thanks. Quote:
Anyway. I like that idea too. just storing the session variable of the
primary key.
in my case (user_id_number), and just using that to conquer everything
else.
>
OK, i have another question about this re-write i want to do. Please
understand, i started learning php about 10 months ago by building our
huge website with it. couple of hundered scripts now.
>
there is a lot i find on the web about MVC. But also found that it
seems to be best for simple CRUD. What we have here is a lot more
complex. We are pulling machine data, processing it, displaying graphs
of machine effeciency, history of machine performance, etc.. Once
things get complex like that, not like a blog site or something, does
an MVC still make sense ?
>
thanks.
>
sk
>
Probably, but I don't use packages. I typically define my own class
hierarchy. With a little practice and some templates I created, it
doesn't take me long.
One set of classes to interface to the database, then one on top of that
for the business logic.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | | | | re: need a pointer on OOP with php
Jerry Stuckle wrote: Quote:
nephish wrote: Quote:
Jerry Stuckle wrote: Quote:
>nephish wrote:
>
>>Ok, well what i have been doing is creating session variables for
>>everything possible that relates to what one may call an object (not in
>>the code, but at the site)
>>like $name = $_SESSION['name'];
>>$email = $_SESSION['email'];
>>$phone = yadda, yadda, yadda
>>
>>so, i suppose this is still the easier way to pull this off.
>>thanks for all the info, i am trying to learn as much as possible
>>because i want to redesign everything in the fall. i started learning
>>php about a year ago, and a whole lot of stuff i did last Fall, i would
>>do differently this Fall.
>>So i want to make it as streamlined as possible.
>>
>>thanks for all your help
>>
>>shawn
>>
>>
>
>How I typically do it (since I have my data in a database) is to store
>the primary key to the entry in my $_SESSION object. Then I fetch
>whatever I need from the database when I need it.
>
>I find this to be much cleaner code. It also fetches current
>information in the (admittedly unlikely) event the data is changed while
>you're passing it around.
>
>P.S. Please don't top post. This newsgroup uses bottom (or inline)
>posting as the standard.
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstucklex@attglobal.net
>==================
by bottom post, you mean write my stuff at the bottom of the text entry
box ?
like this ? Sorry about that. I have kinda wondered which is better.
>
Yep, or intermingled, like this. Thanks.
>
> Quote:
Anyway. I like that idea too. just storing the session variable of the
primary key.
in my case (user_id_number), and just using that to conquer everything
else.
OK, i have another question about this re-write i want to do. Please
understand, i started learning php about 10 months ago by building our
huge website with it. couple of hundered scripts now.
there is a lot i find on the web about MVC. But also found that it
seems to be best for simple CRUD. What we have here is a lot more
complex. We are pulling machine data, processing it, displaying graphs
of machine effeciency, history of machine performance, etc.. Once
things get complex like that, not like a blog site or something, does
an MVC still make sense ?
thanks.
sk
>
Probably, but I don't use packages. I typically define my own class
hierarchy. With a little practice and some templates I created, it
doesn't take me long.
>
One set of classes to interface to the database, then one on top of that
for the business logic.
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================
now, i had thought of that, because what we are doing is as far from
Drupal as one can imagine. I just thought it might be easier to try to
customize something else. I kinda don't get along with PEAR for db
stuff, but i like it for mail. i suppose i can write my own templates.
At least i would know how it works.
thanks | | | | re: need a pointer on OOP with php
nephish wrote: Quote:
Jerry Stuckle wrote:
> Quote:
>>nephish wrote:
>> Quote:
>>>Jerry Stuckle wrote:
>>>
>>>
>>>>nephish wrote:
>>>>
>>>>
>>>>>Ok, well what i have been doing is creating session variables for
>>>>>everything possible that relates to what one may call an object (not in
>>>>>the code, but at the site)
>>>>>like $name = $_SESSION['name'];
>>>>>$email = $_SESSION['email'];
>>>>>$phone = yadda, yadda, yadda
>>>>>
>>>>>so, i suppose this is still the easier way to pull this off.
>>>>>thanks for all the info, i am trying to learn as much as possible
>>>>>because i want to redesign everything in the fall. i started learning
>>>>>php about a year ago, and a whole lot of stuff i did last Fall, i would
>>>>>do differently this Fall.
>>>>>So i want to make it as streamlined as possible.
>>>>>
>>>>>thanks for all your help
>>>>>
>>>>>shawn
>>>>>
>>>>>
>>>>
>>>>How I typically do it (since I have my data in a database) is to store
>>>>the primary key to the entry in my $_SESSION object. Then I fetch
>>>>whatever I need from the database when I need it.
>>>>
>>>>I find this to be much cleaner code. It also fetches current
>>>>information in the (admittedly unlikely) event the data is changed while
>>>>you're passing it around.
>>>>
>>>>P.S. Please don't top post. This newsgroup uses bottom (or inline)
>>>>posting as the standard.
>>>>
>>>>--
>>>>==================
>>>>Remove the "x" from my email address
>>>>Jerry Stuckle
>>>>JDS Computer Training Corp.
>>>>jstucklex@attglobal.net
>>>>==================
>>>
>>>
>>>by bottom post, you mean write my stuff at the bottom of the text entry
>>>box ?
>>>like this ? Sorry about that. I have kinda wondered which is better.
>>>
>>
>>Yep, or intermingled, like this. Thanks.
>>
>>
>> Quote:
>>>Anyway. I like that idea too. just storing the session variable of the
>>>primary key.
>>>in my case (user_id_number), and just using that to conquer everything
>>>else.
>>>
>>>OK, i have another question about this re-write i want to do. Please
>>>understand, i started learning php about 10 months ago by building our
>>>huge website with it. couple of hundered scripts now.
>>>
>>>there is a lot i find on the web about MVC. But also found that it
>>>seems to be best for simple CRUD. What we have here is a lot more
>>>complex. We are pulling machine data, processing it, displaying graphs
>>>of machine effeciency, history of machine performance, etc.. Once
>>>things get complex like that, not like a blog site or something, does
>>>an MVC still make sense ?
>>>
>>>thanks.
>>>
>>>sk
>>>
>>
>>Probably, but I don't use packages. I typically define my own class
>>hierarchy. With a little practice and some templates I created, it
>>doesn't take me long.
>>
>>One set of classes to interface to the database, then one on top of that
>>for the business logic.
>>
>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>jstucklex@attglobal.net
>>==================
>
>
now, i had thought of that, because what we are doing is as far from
Drupal as one can imagine. I just thought it might be easier to try to
customize something else. I kinda don't get along with PEAR for db
stuff, but i like it for mail. i suppose i can write my own templates.
At least i would know how it works.
>
thanks
>
I don't use PEAR, either. Just the mysqli classes on PHP 5 (before I
used the mysql interface).
I have a generic database class template and a table template I can
easily modify. One of these days I'll write a little code to fetch the
columns in the table and gen the entire class. But I never bothered
because it only takes a few minutes to gen the entire class by hand.
Then I modify it for table-specific stuff and I'm done.
The whole thing goes pretty quickly.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | | | | re: need a pointer on OOP with php
Jerry Stuckle wrote: Quote:
nephish wrote: Quote:
Jerry Stuckle wrote: Quote:
>nephish wrote:
>
>>Jerry Stuckle wrote:
>>
>>
>>>nephish wrote:
>>>
>>>
>>>>Ok, well what i have been doing is creating session variables for
>>>>everything possible that relates to what one may call an object (not in
>>>>the code, but at the site)
>>>>like $name = $_SESSION['name'];
>>>>$email = $_SESSION['email'];
>>>>$phone = yadda, yadda, yadda
>>>>
>>>>so, i suppose this is still the easier way to pull this off.
>>>>thanks for all the info, i am trying to learn as much as possible
>>>>because i want to redesign everything in the fall. i started learning
>>>>php about a year ago, and a whole lot of stuff i did last Fall, i would
>>>>do differently this Fall.
>>>>So i want to make it as streamlined as possible.
>>>>
>>>>thanks for all your help
>>>>
>>>>shawn
>>>>
>>>>
>>>
>>>How I typically do it (since I have my data in a database) is to store
>>>the primary key to the entry in my $_SESSION object. Then I fetch
>>>whatever I need from the database when I need it.
>>>
>>>I find this to be much cleaner code. It also fetches current
>>>information in the (admittedly unlikely) event the data is changed while
>>>you're passing it around.
>>>
>>>P.S. Please don't top post. This newsgroup uses bottom (or inline)
>>>posting as the standard.
>>>
>>>--
>>>==================
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>jstucklex@attglobal.net
>>>==================
>>
>>
>>by bottom post, you mean write my stuff at the bottom of the text entry
>>box ?
>>like this ? Sorry about that. I have kinda wondered which is better.
>>
>
>Yep, or intermingled, like this. Thanks.
>
>
>
>>Anyway. I like that idea too. just storing the session variable of the
>>primary key.
>>in my case (user_id_number), and just using that to conquer everything
>>else.
>>
>>OK, i have another question about this re-write i want to do. Please
>>understand, i started learning php about 10 months ago by building our
>>huge website with it. couple of hundered scripts now.
>>
>>there is a lot i find on the web about MVC. But also found that it
>>seems to be best for simple CRUD. What we have here is a lot more
>>complex. We are pulling machine data, processing it, displaying graphs
>>of machine effeciency, history of machine performance, etc.. Once
>>things get complex like that, not like a blog site or something, does
>>an MVC still make sense ?
>>
>>thanks.
>>
>>sk
>>
>
>Probably, but I don't use packages. I typically define my own class
>hierarchy. With a little practice and some templates I created, it
>doesn't take me long.
>
>One set of classes to interface to the database, then one on top of that
>for the business logic.
>
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstucklex@attglobal.net
>==================
now, i had thought of that, because what we are doing is as far from
Drupal as one can imagine. I just thought it might be easier to try to
customize something else. I kinda don't get along with PEAR for db
stuff, but i like it for mail. i suppose i can write my own templates.
At least i would know how it works.
thanks
>
I don't use PEAR, either. Just the mysqli classes on PHP 5 (before I
used the mysql interface).
>
I have a generic database class template and a table template I can
easily modify. One of these days I'll write a little code to fetch the
columns in the table and gen the entire class. But I never bothered
because it only takes a few minutes to gen the entire class by hand.
Then I modify it for table-specific stuff and I'm done.
>
The whole thing goes pretty quickly.
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
==================
Thats what i had in mind, i need desperately to clean up how all my
stuff works now,
but i could make a class that defines a customer, or a customers
machine, and populate it on the fly from an sql look-up, and keep it
constant throuout. Thats my main mess now, as i learned new stuff, the
site is less and less consistant.
Thanks for your help and advise.
shawn |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,439 network members.
|