PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Where to start!
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Where to start!

Réponse
 
LinkBack Outils de la discussion
Vieux 05/05/2008, 08h15   #1
Jorge
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Where to start!

First I would like to say that I have had PHP experience but not enough to
say I am a PHP developer.

I want to use PHP to build a site that uses MySQL, I am building it from
scratch so I don't know where to start, should I start with PHP and design a
database around my code, or should I designs the db and design the site are
the db.

is it just a matter of preference or is there a recommended way to do this?

Thanks

  Réponse avec citation
Vieux 05/05/2008, 08h45   #2
Tony Marston
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Where to start!

As a person who has been developing database applications for several
decades my advice is to ALWAYS start with the database design, then build
your code around that. The database must be properly normalised otherwise it
will be difficult to get at the data you need in an efficient manner.

OO "purists" will say that you should start with your class hierarchy and
leave the database till last as it is a "mere implementation detail". This
usually results in a software structure which is different from the database
structure - known as Object-Relational impedance mismatch - and requires the
addition of an extra layer of software known as an Object Relational Mapper
(ORM). I consider these to be EVIL, as discussed in
http://www.tonymarston.net/php-mysql...-are-evil.html

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


""Jorge"" <japreja@msn.com> wrote in message
news:E0.C0.40102.C04BE184@pb1.pair.com...
> First I would like to say that I have had PHP experience but not enough to
> say I am a PHP developer.
>
> I want to use PHP to build a site that uses MySQL, I am building it from
> scratch so I don't know where to start, should I start with PHP and design
> a database around my code, or should I designs the db and design the site
> are the db.
>
> is it just a matter of preference or is there a recommended way to do
> this?
>
> Thanks



  Réponse avec citation
Vieux 05/05/2008, 09h29   #3
Robert Cummings
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Where to start!


On Mon, 2008-05-05 at 01:15 -0600, Jorge wrote:
> First I would like to say that I have had PHP experience but not enough to
> say I am a PHP developer.
>
> I want to use PHP to build a site that uses MySQL, I am building it from
> scratch so I don't know where to start, should I start with PHP and design a
> database around my code, or should I designs the db and design the site are
> the db.
>
> is it just a matter of preference or is there a recommended way to do this?


Database first. You can tailor it when you write your code if you've
missed stuff, but in a "from-scratch-project" it should be 90%
determined before you write the code.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

  Réponse avec citation
Vieux 05/05/2008, 10h15   #4
Richard Heyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Where to start!

> The database must be properly normalised otherwise it
> will be difficult to get at the data you need in an efficient manner.


Not true. If your needs are simple for example, normalisation can
increase the complexity of a schema, hence increasing development time
needed. Sometimes for example you could use something like a SET type,
and search for something in it using FIND_IN_SET().

--
Richard Heyes

+----------------------------------------+
| Access SSH with a Windows mapped drive |
| http://www.phpguru.org/sftpdrive |
+----------------------------------------+
  Réponse avec citation
Vieux 05/05/2008, 10h18   #5
Børge Holen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Where to start!

On Monday 05 May 2008 09:15:29 Jorge wrote:
> First I would like to say that I have had PHP experience but not enough to
> say I am a PHP developer.
>
> I want to use PHP to build a site that uses MySQL, I am building it from
> scratch so I don't know where to start, should I start with PHP and design
> a database around my code, or should I designs the db and design the site
> are the db.
>
> is it just a matter of preference or is there a recommended way to do this?
>
> Thanks


I did it all from scratch (both the learning, and creating), did it the other
way around, I started with PHP, REGRETTED that for some time.
Start off with the db structure, then go over it again, and again for good
measure.


--
---
Børge Holen
http://www.arivene.net
  Réponse avec citation
Vieux 05/05/2008, 10h31   #6
Tony Marston
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Where to start!

"Richard Heyes" <richardh@phpguru.org> wrote in message
news:481ED03B.7090200@phpguru.org...
> > The database must be properly normalised otherwise it
>> will be difficult to get at the data you need in an efficient manner.

>
> Not true. If your needs are simple for example, normalisation can increase
> the complexity of a schema, hence increasing development time needed.
> Sometimes for example you could use something like a SET type, and search
> for something in it using FIND_IN_SET().


I disagree. The database should ALWAYS be normalised to at least the 3rd
normal form. Sometimes going beyond that to 4NF, 5NF or 6NF becomes too
complex.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


> --
> Richard Heyes
>
> +----------------------------------------+
> | Access SSH with a Windows mapped drive |
> | http://www.phpguru.org/sftpdrive |
> +----------------------------------------+



  Réponse avec citation
Vieux 05/05/2008, 10h45   #7
ticom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Where to start!

I usually start with the code, en create the db as soon as i have code that
uses it. Coz of this i dont really think about the db design, what results
in a huge and uneffective database.
I think you could best start with writing down the functions your site
needs, then creating the db and then finally write the code.

ticom/timothy de vries

""Jorge"" <japreja@msn.com> wrote in message
news:E0.C0.40102.C04BE184@pb1.pair.com...
> First I would like to say that I have had PHP experience but not enough to
> say I am a PHP developer.
>
> I want to use PHP to build a site that uses MySQL, I am building it from
> scratch so I don't know where to start, should I start with PHP and design
> a database around my code, or should I designs the db and design the site
> are the db.
>
> is it just a matter of preference or is there a recommended way to do
> this?
>
> Thanks



  Réponse avec citation
Vieux 05/05/2008, 11h10   #8
Richard Heyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: Where to start!

Tony Marston wrote:
> "Richard Heyes" <richardh@phpguru.org> wrote in message
> news:481ED03B.7090200@phpguru.org...
>>> The database must be properly normalised otherwise it
>>> will be difficult to get at the data you need in an efficient manner.

>> Not true. If your needs are simple for example, normalisation can increase
>> the complexity of a schema, hence increasing development time needed.
>> Sometimes for example you could use something like a SET type, and search
>> for something in it using FIND_IN_SET().

>
> I disagree. The database should ALWAYS be normalised to at least the 3rd
> normal form. Sometimes going beyond that to 4NF, 5NF or 6NF becomes too
> complex.


Sometimes it's just a waste of time. If your site isn't that busy, and
speed isn't crucial, why waste the time using a more complicated
database structure?

--
Richard Heyes

+----------------------------------------+
| Access SSH with a Windows mapped drive |
| http://www.phpguru.org/sftpdrive |
+----------------------------------------+
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h09.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20412 seconds with 16 queries