Kingdom, Phylum, Order, Class, Family, Genus, HTTP???

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Kingdom, Phylum, Order, Class, Family, Genus, HTTP???

Post by neophyte »

How might one group the following classes that create and edit Cookies and http headers?

class HTTP_Headers?

Would you group them in a directory called "HTTP"?
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Kingdom, Phylum, Class, Order, Family, Genus, Species! I still remember a little song for that from life science 8)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Yes, I think a number of frameworks put then in a HTTP(or Http) directory.
(#10850)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

or "Request" directory :)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I don't think Request would be quite correct: Headers and Cookies are the Response.

HTTP is a reasonably good name. I would also consider not grouping them together and having Cookie and Header classes. :-P
Last edited by Ambush Commander on Wed Sep 27, 2006 8:58 pm, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Ambush Commander wrote:I don't think Request would be quite correct: Headers and Cookies are the Response.
I think they are actually in both. It would depend on whether neophyte's classes were getting or setting them.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Yeah, for Cookie that's right. Headers, less so. PHP programmers usually don't dabble in request headers (although there are fringe cases).
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

My classes will be setting headers and cookies. No getting here. Probably will be getting the cookies with a request object. In a different class. So HTTP is a good name then?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I'd call it Http_Response (which is what I call mine).
(#10850)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Ambush Commander wrote:Yeah, for Cookie that's right. Headers, less so. PHP programmers usually don't dabble in request headers (although there are fringe cases).
Any data found with HTTP_ prefix is from the headers sent by the user agent. (With one or two exceptions) So developers do often mix with request headers. :)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Heh... I guess I mean we don't usually deal with raw request headers. Got me again.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Sorry, I'm pedantic at times :)
Post Reply