in reply to High level OOP query
Typically, I initialize things immediately that aren't going to block my application (meaning, things that aren't CPU or memory intensive). Then, I lazily load everything else, either through setters, or even more lazily, when I want to persist something through a method call (say I have a save() method, I'll initialize whatever I need prior, then if I have an attribute that doesn't need to be set prior to calling save, say something like, retrieve_siblings(), which we will say hits a database, or something else that generates a thumbnail that hasn't been cached yet. That way you're calling it at the last possible moment and not creating a bottleneck in your application unnecessarily. Of course, this is a bit further down the road, there's no need for optimization until you've actually discovered slow parts in your code.
I also strongly suggest you learn how Moose and Moo work. They bring a sane object system into the Perl land and have some very, very good developers working on them.
Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: High level OOP query ( Building Skills Object-Oriented Design Mindset Development )
by Anonymous Monk on Oct 25, 2013 at 22:25 UTC | |
by stonecolddevin (Parson) on Oct 25, 2013 at 22:29 UTC | |
by Anonymous Monk on Oct 25, 2013 at 22:46 UTC |