[BNM] Dumb PHP question

Antony Jones antonyj at gamesys.co.uk
Mon Jun 4 09:45:53 BST 2007


> A bit of a shame you have to provide your own hook to be able to add
such
> things. A waste of the programmers time, and additional lines of code
to
> host bugs.

Not in ruby!

Anyway there should be no risk of bugs with getters and setters - for
most purposes a DAO (which has the getters and setters) will contain no
business logic, The exception being when you start using your model to
define rules (for data integrity), which is one of those approaches
which is either completely right or completely wrong - and nobody will
agree on which.

But yes, you should never access properties directly, at least that's
the thinking in the Java world.

Antony Jones
Developer
 
Gamesys Limited
e: antonyj at gamesys.co.uk
t: 0207 478 8103
a: 1st Floor, 54-62 Regent Street, LONDON, W1B 5RE
 
Save trees and protect the environment - think before you print this
email!
> -----Original Message-----
> From: bnmlist-bounces at brightonnewmedia.org [mailto:bnmlist-
> bounces at brightonnewmedia.org] On Behalf Of paul perrin
> Sent: 03 June 2007 18:56
> To: Brighton New Media
> Subject: Re: [BNM] Dumb PHP question
> 
> A bit of a shame you have to provide your own hook to be able to add
such
> things. A waste of the programmers time, and additional lines of code
to
> host bugs.
> 
> Paul /)/+)
> 
> On 03/06/07, Tom Hume <Tom.Hume at futureplatforms.com> wrote:
> >
> > Nope; they let you add things like value and type checking later on
> > without having to do massive search-and-replaces on your code.
> >
> > On 3 Jun 2007, at 00:32, paul perrin wrote:
> >
> > > Isn't the automatic use of getter and setter methods the last
> > > refuge for those that don't really know when to use public
properties?
> > >
> > > Paul /)/+)l
> > >
> > >
> > > On 02/06/07, Richard Maynard / Wessex Networks
> > > <rjm at wessexnetworks.com>
> > > wrote:
> > >>
> > >> Shouldn't class variables be modified with getter and setter
methods
> > >> rather
> > >> than modifying them as if public?
> > >>
> > >> I believe that is what is called bad practice in Java, but PHP
> > >> seems to be
> > >> more of a free-for-all when it comes to best practices.
> > >>
> > >> Richard.
> > >>
> > >> Wessex Networks
> > >> Linchmere Place
> > >> Ifield
> > >> Crawley
> > >> West Sussex
> > >> RH11 0EX
> > >> www.wessexnetworks.com rjm at wessexnetworks.com
> > >> T: 01293 542080 F: 01293 553849
> > >>
> > >> -----Original Message-----
> > >> From: bnmlist-bounces at brightonnewmedia.org
> > >> [mailto:bnmlist-bounces at brightonnewmedia.org] On Behalf Of Justin
> > >> Wanstall
> > >> Sent: 02 June 2007 12:11
> > >> To: 'Brighton New Media'
> > >> Subject: Re: [BNM] Dumb PHP question
> > >>
> > >> The $claim part refers to an instance of a class which has been
> > >> initiated
> > >> and the ->value is simply a value within that instance. It's
Object
> > >> Oriented
> > >> programming.
> > >>
> > >> http://en.wikipedia.org/wiki/Object-oriented_programming
> > >>
> > >> Justin.
> > >>
> > >> -----Original Message-----
> > >> From: Alan Newman [mailto:alan at sensibledevelopment.com]
> > >> Sent: 02 June 2007 11:52
> > >> To: 'Brighton New Media'
> > >> Subject: [BNM] Dumb PHP question
> > >>
> > >> Hi,
> > >>
> > >>
> > >>
> > >> We have inherited a PHP UI for a back end application we are
> > >> customizing
> > >> and
> > >> I can't find an answer to this on the web, but I suspect I am
just
> > >> not
> > >> looking in the right places.
> > >>
> > >>
> > >>
> > >> We are seeing this sort of expression a lot and are not sure what
> > >> it is:
> > >>
> > >>
> > >>
> > >> $claim->value
> > >>
> > >>
> > >>
> > >> It seems to come up a lot - is it some sort of "injection" of one
> > >> value in
> > >> to another? It would really help to know what is going in and
> > >> would help
> > >> out
> > >> us silly Java types a lot!
> > >>
> > >>
> > >>
> > >> Cheers
> > >>
> > >>
> > >>
> > >> - Alan
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> HYPERLINK "http://
> > >> www.sensibledevelopment.com"www.sensibledevelopment.com-
> > >> scalable back end web development that looks good.
> > >>
> > >>
> > >>
> > >> ::email:: HYPERLINK
> > >> "mailto:alan at sensibledevelopment.com"alan at sensibledevelopment.com
> > >>
> > >> ::land:: +44 (0)1273 621110
> > >>
> > >> ::mobile:: +44 (0)7711 006551
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> No virus found in this outgoing message.
> > >> Checked by AVG Free Edition.
> > >> Version: 7.5.472 / Virus Database: 269.8.6/828 - Release Date:
> > >> 01/06/2007
> > >> 11:22
> > >>
> > >> --
> > >>
> > >>
> > >> BNM Social - http://upcoming.yahoo.com/event/190648
> > >>
> > >> BNM Subscribe/Unsubscribe:
> > >> http://lists.wessexnetworks.com/cgi-bin/mailman/options/bnmlist/
> > >> BNM info/archives:
> > >> http://www.brightonnewmedia.org/
> > >>
> > >> BNM archive search:
> > >> http://www.roddis.org/bnm/search.php
> > >>
> > >> BNM powered by Wessex Networks:
> > >> http://www.wessexnetworks.com
> > >>
> > >> --
> > >>
> > >>
> > >> BNM Social - http://upcoming.yahoo.com/event/190648
> > >>
> > >> BNM Subscribe/Unsubscribe:
> > >> http://lists.wessexnetworks.com/cgi-bin/mailman/options/bnmlist/
> > >> BNM info/archives:
> > >> http://www.brightonnewmedia.org/
> > >>
> > >> BNM archive search:
> > >> http://www.roddis.org/bnm/search.php
> > >>
> > >> BNM powered by Wessex Networks:
> > >> http://www.wessexnetworks.com
> > >>
> > >> --
> > >>
> > >>
> > >> BNM Social - http://upcoming.yahoo.com/event/190648
> > >>
> > >> BNM Subscribe/Unsubscribe:
> > >> http://lists.wessexnetworks.com/cgi-bin/mailman/options/bnmlist/
> > >> BNM info/archives:
> > >> http://www.brightonnewmedia.org/
> > >>
> > >> BNM archive search:
> > >> http://www.roddis.org/bnm/search.php
> > >>
> > >> BNM powered by Wessex Networks:
> > >> http://www.wessexnetworks.com
> > >>
> > > --
> > >
> > >
> > > BNM Social - http://upcoming.yahoo.com/event/190648
> > >
> > > BNM Subscribe/Unsubscribe:
http://lists.wessexnetworks.com/cgi-bin/
> > > mailman/options/bnmlist/
> > > BNM info/archives:
> > > http://www.brightonnewmedia.org/
> > >
> > > BNM archive search:
> > > http://www.roddis.org/bnm/search.php
> > >
> > > BNM powered by Wessex Networks:
> > > http://www.wessexnetworks.com
> > >
> >
> > --
> > Future Platforms Ltd
> > e: Tom.Hume at futureplatforms.com
> > t: +44 (0) 1273 819038
> > m: +44 (0) 7971 781422
> > company: www.futureplatforms.com
> > personal: tomhume.org
> >
> >
> > --
> >
> >
> > BNM Social - http://upcoming.yahoo.com/event/190648
> >
> > BNM Subscribe/Unsubscribe:
> > http://lists.wessexnetworks.com/cgi-bin/mailman/options/bnmlist/
> > BNM info/archives:
> > http://www.brightonnewmedia.org/
> >
> > BNM archive search:
> > http://www.roddis.org/bnm/search.php
> >
> > BNM powered by Wessex Networks:
> > http://www.wessexnetworks.com
> >
> --
> 
> 
> BNM Social - http://upcoming.yahoo.com/event/190648
> 
> BNM Subscribe/Unsubscribe: http://lists.wessexnetworks.com/cgi-
> bin/mailman/options/bnmlist/
> BNM info/archives:
> http://www.brightonnewmedia.org/
> 
> BNM archive search:
> http://www.roddis.org/bnm/search.php
> 
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com



More information about the BNMlist mailing list. Powered by Wessex Networks