Closed crossan007 closed 4 years ago
Hi @crossan007
Definitely a nice idea! Currently the source code contains links to URLs for the majority of the holidays. Are you thinking of a function for the Holiday class that returns those URL's? Or did you have something else in mind?
Cheers! Sacha
Exactly!
So, instead of the @ link
comment (https://github.com/azuyalabs/yasumi/blob/develop/src/Yasumi/Provider/CommonHolidays.php#L36), the class Holiday
could implement a getURLs() : array[]
function which returns an array of type string (or possibly a new DTO for link - if we think more link metadata could be helpful).
This would enable applications using Yasumi to provide a user-facing link to view holiday details.
I think each URL is rather a ValueObject than a DTO ;) Anyways, each Holiday could indeed return a collection of URL's that are defined within the class. As for any metadata, do you have some ideas/suggestions for that? What I can think of right now is the 'source', however that can possible be deduced from the URL.
So we could have:
An additional (possibly useful) property of the 'source' object may be an ENUM value representing the "authoritativeness" (or a better word) of the 'source'. I.E. COMMUNITY_MAINTAINED
, vs GOVERNMENT_OFFICIAL
to allow data-class-consumers to differentiate "wikipedia-like" sites from "official" sites.
There are probably other "information authority classifications" that would fit here, but I can't seem to think of any ;-)
Also - instead of source
, HolidayInformationalReference
may be a good name for the ValueObject
.
That is indeed a valuable property. Other ones could also be:
My only concern at the moment is that it would become a pretty heavy ValueObject :) Perhaps it is best to start simple.
Of those you listed, I think Date of Last Revision
would be the simplest to include with the highest benefit.
Would Author
be person / organization / government credited with creating the content at the URL? Or the person who contributed the HolidayInformationalReference
data?
Not sure how we can "objectively" quantify Objectivity
and Accuracy
:-) but I like the idea!
Author
would be indeed the person / organization / government that is the owner of the source. Perhaps this one is of low benefit.
Indeed Objectivity
and Accuracy
might be hard to quantify and even testify as it can be quite subjective. It was just a thought :)
I have some good idea how to do this :) At the moment I am working on making the Yasumi v2.2 release, so I will have a go after that.
This issue has been open 30 days with no activity. Please remove the stale label or comment, or this will be closed in 5 days
It would be nice to have a curated list of links to URLs for details about the specified holiday.