New Releases

30 views
Skip to first unread message

pmjo...@gmail.com

unread,
Dec 1, 2015, 10:35:52 AM12/1/15
to aur...@googlegroups.com
Hi everyone!

We have released these new package versions:

Aura.Payload_Interface version 3.0.0, with these changes:

First stable release.


Please let us know if you have any questions, comments, or concerns about this or any other release. And thanks, as always, for supporting Aura!

--
The team at the Aura project
http://auraphp.com

pmjo...@gmail.com

unread,
Dec 1, 2015, 10:37:10 AM12/1/15
to aur...@googlegroups.com
Hi everyone!

We have released these new package versions:

Aura.Payload version 3.0.0, with these changes:

pmjo...@gmail.com

unread,
Dec 1, 2015, 10:37:21 AM12/1/15
to aur...@googlegroups.com
Hi everyone!

We have released these new package versions:

Aura.Router version 3.0.0, with these changes:

First stable release.

- Default factories now use serializable method calls.

- Honor the route host and the secure flag in Generator.

nyamsprod

unread,
Dec 2, 2015, 2:59:57 AM12/2/15
to The Aura Project for PHP
Hi all!

I have a question regarding the PayloadStatus class. If I understand it correctly, the purpose of the class is to give some basic Payload Status.  I wanted to know why you choose to implements those constants on a class rather than on a interface ?

In both case you would end up with a set of predefined constants that can be used or extended using PHP inheritance features. But making PayloadStatus an interface disallow any extended class to override the predefined constant values, something which I think would allow for a better usage of the PayloadStatus. Thoughts ?

Hari K T

unread,
Dec 2, 2015, 3:25:07 AM12/2/15
to aur...@googlegroups.com
Hi,

There was also a twitter conversation about the topic earlier.

https://twitter.com/gmazzap/status/664810125681672194

Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nyamsprod

unread,
Dec 2, 2015, 9:22:44 AM12/2/15
to The Aura Project for PHP
Hi Hari,

I understand the drawbacks of having the constants defined in a distinct interface class but again if this is just implementation details then the PayloadStatus is not needed.

With the current class the problem is not that the developer is able to add his own constant but he also has the ability to override the currently written constant.
I perfectly understand that this is not wise but the only way to prevent this is to:

- put the constants in a interface, with the exposed issues;
- or remove them completely from the package;

IMHO the current solution is like having an Interface with the added issue of having constant class that could be potentially overwritten.

Paul M. Jones

unread,
Dec 2, 2015, 11:40:03 AM12/2/15
to aur...@googlegroups.com

> On Dec 2, 2015, at 01:59, nyamsprod <nyam...@gmail.com> wrote:
>
> Hi all!
>
> I have a question regarding the PayloadStatus class. If I understand it correctly, the purpose of the class is to give some basic Payload Status.

Correct. It's a generic list of statuses that are likely to apply to many different Domain situations.


> I wanted to know why you choose to implements those constants on a class rather than on a interface ?

It was previously on an interface, but there was some discussion as to whether that was appropriate. The final "convincer" for me was this article <https://en.wikipedia.org/wiki/Constant_interface> where it says:

> constants are very often merely an implementation detail, and the interfaces implemented by a class are part of its exported API, this practice amounts to putting implementations details into the API, which was considered inappropriate

Granted, that article is about interfaces of *only* constants, but I think the principle applies when interface methods are present as well.

You can see the extended conversations at ...

- <https://github.com/auraphp/Aura.Payload_Interface/pull/2>
- <https://github.com/auraphp/Aura.Payload_Interface/pull/3>

... and note that there was a lot of back-and-forth trying to determine "the right thing."


> But making PayloadStatus an interface disallow any extended class to override the predefined constant values, something which I think would allow for a better usage of the PayloadStatus. Thoughts ?

Overriding the predefined constant values in a domain-specific Payload is *exactly* something we want to allow for. Indeed, one should seriously consider using Domain-specific statuses that more accurately reflect the specific Domain.

Hope that helps explain the reasoning.


--
Paul M. Jones
pmjo...@gmail.com
http://paul-m-jones.com

Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp

Solving the N+1 Problem in PHP
https://leanpub.com/sn1php


nyamsprod

unread,
Dec 3, 2015, 4:12:44 AM12/3/15
to The Aura Project for PHP
Hi Paul,

Thanks for the reply and the explanation.
Reply all
Reply to author
Forward
0 new messages