Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: OOP introspection (composition)

by LanX (Saint)
on Apr 03, 2021 at 10:07 UTC ( [id://11130763]=note: print w/replies, xml ) Need Help??


in reply to Re: OOP introspection (composition)
in thread OOP introspection

could be that I totally misunderstood your question about composition as "composing" a class with roles

compare

https://perldoc.perl.org/perlootut#Roles

vs

https://perldoc.perl.org/perlootut#Composition °

In case you meant the latter:

This is extremely difficult in dynamically typed languages.

You would of course parse the code for use of other classes and constructors named "new".

But this would only give you a fragile approximation of dependencies at best, because of all the flexibility Perl offers.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) which is very generally speaking and fuzzy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130763]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found