View Full Version : At the core of an object
06-09-2007, 12:25 AM
The other day i ran into a case where i had an object with almost all its methods executing the same check at start.
Which led me to wonder if there is any high level method that runs no matter what lower level method is called, where i could implement this check???
06-09-2007, 01:01 AM
not quite sure what you are talking about.... could you provide an example of what you are talking about, and maybe a little more explaination?
06-09-2007, 01:47 AM
ok, let's take a very basic example to illustrate what im trying to do:
pretend i have a object of class Dog with the following function "bark", "run", "eat". In every of these methods, i have a check that basically does:
what i want to do, is pre-register at initialization level the methods subject to this check and call another method (wake up) if (asleep),
rather than having the same check within each function
06-09-2007, 04:20 PM
very nice little piece of code.
I am going to dig into the whole Aspect Oriented Programming concept, this seems to be only the tip of a powerful iceberg. thanks!!
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.