--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Did you mean to +1 in the voting thread, which says mostly the same thing?
--Larry Garfield
On 12/4/12 9:32 AM, Ryan Parman wrote:
+1
--
*Ryan Parman*
Geek. Writer. Music Lover.
http://ryanparman.com <http://ryanparman.com/>
"Illiteracy will not be defined by those who cannot read and write, but
by those who cannot learn and relearn." — Alvin Toffler
<mailto:jerem...@gmail.com>> wrote:
Amazon Web Services – AWS SDK for PHP@jeremeamia <https://twitter.com/jeremeamia> •
https://github.com/jeremeamia
--
You received this message because you are subscribed to the Google
Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com
<mailto:php-fig@googlegroups.com>.
To unsubscribe from this group, send email to
--
You received this message because you are subscribed to the Google
Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
"Sometimes we see code with classes that are named by adding “Impl ” to the single interface they implement. This is better than leaving the class name unchanged and prefixing an “I ” to the interface, but not much. A name like FooImpl is duplication, it says exactly the same as implements Foo , which is a code smell. We would not tolerate such obvious duplication elsewhere in our code, so we ought to refactor it away.
It might just be a naming problem. There’s always something specific about an implementation that can be included in the class name: it uses a bounded collection, it communicates over HTTP, it uses a database for persistence, and so on. A bridging class is even easier to name, since it will belong in one domain but implement interfaces in another: for example, SnipersTableModel (a user interface class) implements SniperListener and PortfolioListener (from the application core).
If there really isn’t a good implementation name, it might mean that the interface is poorly named or designed. Perhaps it’s unfocussed because it has too many responsibilities, or it’s named after its implementation rather than its role in the client, or (just occasionally) that it’s a value not an object—this discrepancy sometimes turns up when writing unit tests
I'm pro to not suffix interfaces and traits, but rather use *-able like naming convention.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/74N-R0MSfSkJ.
In your simple examples I agree, those are great interface names.
But as mentioned before on this list, complex systems have many interfaces, and the english language simply does not allow adding 'able' just about everywhere, without resorting to incredibly convoluted naming.
I too started with the 'able' prefix in the advent of my project, but after some time you realize this is an unworkable situation. I'm certain that the other people who voted +1 one this proposal have ran into the same thing after some time. It is very hard to come with names for every abstract concept, let alone coming up with an adjective that makes sense.
Just like for an exception this would be 'Throwable' and not 'Exceptionable', many of these words simply don't exist in the english language.
-able simply does not work in real life. If you ran a sufficiently large open source project with a strong API, you would know this.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
How about something like this for the part regarding interfaces and traits:
For interfaces and traits, developers are encouraged to use names that promote code readability for API consumers. For example, a trait to add commenting functionality to a class may be called "Commentable", so that type-hinted method signatures read nicely:
public function addComment(Commentable $post);
In cases where a suitable English adjective does not exist or is not sufficiently clear, "Interface" and "Trait" may be appended to the name of the interface or trait, respectively. For example, "SecurityContextInterface".
Does something like that seem OK? The idea is that it provides clear guidelines while still giving developers options to optimize for human readability.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/T4_UBawEFyYJ.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/5bag3n9NdhIJ.