226 reputation
112
bio website
location
age
visits member for 3 years
seen Apr 2 at 6:25

Mar
12
awarded  Popular Question
Feb
25
revised Scheme/Design Pattern for allowing a certain outside class to set properties
added 33 characters in body
Feb
25
comment Scheme/Design Pattern for allowing a certain outside class to set properties
@StefanHanke As per my recent edit, you can loop through the collection object to access each member. You can also retrieve a sub-collection, or a single item by id. The properties are protected. I used to use a get($property) method in a lot of classes but recently have been starting to change over to writing specific methods like getId() to limit access. Currently, $id is visible through those methods.
Feb
25
revised Scheme/Design Pattern for allowing a certain outside class to set properties
edited to add some more methods to classes to show how they could be used
Feb
25
revised Scheme/Design Pattern for allowing a certain outside class to set properties
edited to add some more methods to classes to show how they could be used
Feb
25
comment Scheme/Design Pattern for allowing a certain outside class to set properties
@StefanHanke You are saying that I might have a problem if I want a class other than collection to be able to call the setData() method of item? My purpose was to limit it to the collection class, but it's possible that in the future I might want to allow another class. So do you think this is a bad idea? Should I not worry about who is setting the object's data, and perhaps have the object validate whatever data is being set? Or have some kind of validator class? My purpose was to establish a trusted "partner class" of sorts.
Feb
25
revised Scheme/Design Pattern for allowing a certain outside class to set properties
formatting
Feb
25
asked Scheme/Design Pattern for allowing a certain outside class to set properties
Feb
23
comment PHP extended class method requires same signature including object class requirement?
I guess you're right. I was able to work around that by changing the signature to match the parent, and then adding a bit where it uses if((!$obj instanceof someClassChild) ) return false
Feb
23
asked PHP extended class method requires same signature including object class requirement?
Nov
20
awarded  Popular Question
Nov
5
comment How safe are hidden AJAX requests that fake performance?
Your suggestion is similar to how gmail shows "Saving..." text while the XHR is going, and "Saved" after it's done. If it always said "Saved," who would believe it?
Nov
5
comment How safe are hidden AJAX requests that fake performance?
@JimmyHoffa you would use a unique email id in the delete request. It would be really bad to send delete requests based on the arbitrary display order of the emails in your inbox.
Nov
5
comment How safe are hidden AJAX requests that fake performance?
When composing an email in gmail, you might notice light grey text that says "Saving..." and changes to "Saved" once the operation completes. Another thing is if you have a completely "AJAXy" web app, then couldn't you have handlers for error responses available on all of your "pages"? It's possible because all "navigation" is actually AJAX, and you can still be notified about an error from a previous "page". The error response should allow you to click to go back and view the page with the error and retry or fix the problem.
Oct
14
awarded  Tumbleweed
Oct
7
asked Deduplicating html-attached javascript on page
Sep
27
awarded  Informed
Jul
27
comment Does it make sense to break fluid interface if a bad argument is passed?
@JamesBlack during development, I kind of like having fatal errors that force me to fix bugs immediately. Perhaps when it is ready for customer use, I change the code so that it throws exceptions for the developer, and the customers/users don't see anything weird. ?
Jul
27
comment Does it make sense to break fluid interface if a bad argument is passed?
The more code I write the more I realize that it is a pain to have a method return different types. But I don't mind PHP fatal errors like false->set('number',12) because they show me where there is an unhandled condition in the code. I can use exceptions to do that without breaking the code, but in a way I prefer the code breaks completely than continues running with unplanned for conditions.
Jul
2
awarded  Curious