Acme-Thing

 view release on metacpan or  search on metacpan

lib/Acme/Thing.pm  view on Meta::CPAN

# no code
## no critic: TestingAndDebugging::RequireUseStrict
package Acme::Thing;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-03-19'; # DATE
our $DIST = 'Acme-Thing'; # DIST
our $VERSION = '0.1.0'; # VERSION

1;
# ABSTRACT: Represent anything as Perl (CPAN) module

__END__

=pod

=encoding UTF-8

=head1 NAME

Acme::Thing - Represent anything as Perl (CPAN) module

=head1 SPECIFICATION VERSION

0.1

=head1 VERSION

This document describes version 0.1.0 of Acme::Thing (from Perl distribution Acme-Thing), released on 2023-03-19.

=head1 DESCRIPTION

C<Acme::Thing> is a convention for representing anything as a Perl
module/distribution. Custom prerequisite phase/relationship in distribution
metadata can be used to relate the thing to other things. The C<get_thing_attrs>
class method can be used to rerieve attributes of the thing. The module's POD
can be used to document the thing.

=head2 Naming convention

The module should be named C<Acme::Thing::$SUBNAMESPACE::$NAME> where
C<$SUBNAMESPACE> is one or more levels of subnamespaces and C<$NAME> is the
name/title of the thing. Both C<$SUBNAMESPACE> and C<$TITLE> should use
C<CamelCase> notation and should be in singular noun form whenever possible.
Underscore is used to separate name parts. For example, for a TV series the
C<$NAME> could be the title of the series using the IMDB convention:

 Acme::Thing::TVSeries::BreakingBad_2008_2013
 Acme::Thing::TvSeries::CornerGas_2004_2009

and for a book title the C<$NAME> could be the title (without the subtitle) of
the book, preferrably with the publication year. Subsequent editions of a book
should be named using the C<nE> notation. Examples:

 Acme::Thing::Book::ProgrammingPerl_1991
 Acme::Thing::Book::ProgrammingPerl_4E_2012

=head2 Relationship with other things

TBD.

=head2 Attributes

The module must provide a class method called C<get_thing_attrs> (by itself or
by inheritance, doesn't matter), which must return a L<DefHash> containng
attributes of the thing. The required attributes are:

=over

=item * title

Title of the thing, in a format common for that thing.

=back

For example, for a book title:

 {
   title => "Programming Perl",
   isbn => ...,
   year => 1991,
   summary => ...,
   description => ...,
   ...
 }

For a TV series:

 {
   title => "Breaking Bad",
   year_first => 2008,
   year_last => 2013,
   imdb_title_id => ...,
   summary => ...,
   description => ...,
   ...
 }

=head2 Why?

Now comes the harder question: why use Perl module/distribution to represent
seomthing at all, other than an actual Perl module? Releasing as Perl
distribution and module leverages a few things: 1) the CPAN distribution
metadata (see L<CPAN::Meta>) where a distribution can depend (relate) to other
modules (other things); 2) the CPAN infrastructure where revisions of the thing
can be released, distributed, tested, and installed to target systems; 3) the OO
feature of the Perl language where a user can interact with a thing (e.g.
download a TV series poster or trailer, etc).

Of course, none of the above suggest that a generic representation like
C<Acme::Thing> is better than a more specific one, e.g. C<WebService::ISBNDB>
for books.



( run in 2.144 seconds using v1.01-cache-2.11-cpan-d8267643d1d )