You are here: Re: need a pointer on OOP with php « PHP Programming Language « IT news, forums, messages
Re: need a pointer on OOP with php

Posted by nephish on 08/09/06 01:44

Jerry Stuckle wrote:
> 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

 

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

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