I am trying to use the Perl API, which was written to use the Moose OO system, but there is absolutely no inheritance, aggregation or composition between objects.
And, except for one optional role for debugging, neither roles nor mixins are involved.
As far as I can see at the moment, using Moose just seems to add a huge amount of complications and overhead to compile time for very little benefit.
Why did you use Moose or OO as a simple encapsulation method instead of using a much simpler way to package your code in Perl modules?
To clarify, I am fully convinced of the many benefits of using Moose to run OO in Perl correctly and completely. I just don't understand why use OO at all as a simple encapsulation method? I am not a subjective argument in favor of or otherwise Perl OO. I hope that I am missing some advantage for using the OO paradigm here, that I just don't see atm.
This question contains an excellent sequence of data encapsulation points in Perl. Notabene I'm not talking about forced encapsulation , where the system stops you from searching, where you shouldn't, more about just exposing the methods in a package that manages the data you want to play with.
Is there any advantage in using OO here that I am missing?
Edit 1: After a little detective work, I just saw that the author of the Perl API is also strong participates in the maintenance and support of the Moose framework.
Edit 2: I just saw this question that asks a similar thing from a slightly different angle. It seems that my answer is actually βwhy do you want to add complication in the first place?β, Especially given the information in revision 2 above.
POSSIBLE ANSWER
The API in question apparently only uses the Moose OO system to prevent namespace pollution.
This can also be done more than enough using Perl packages, although, as noted in the @amon note, using the standard package mechanism can be quite cumbersome. BTW Thank you very much for all the comments that will help clarify what I asked.