4 ms·
Its a nice article and the objective-C specific content was informative, but it fails to convince given the fact that it does not even mention aspect orientatio
by lucifer 17y ago
Its a nice article and the objective-C specific content was informative, but it fails to convince given the fact that it does not even mention aspect orientation.
In a language like Java, declarative application of AOP constructs (such as that of AspectJ) give you all the benefits OP cites for dynamic dispatch, with the further benefits of (a) being still able to reap the benefits of efficient look-up and optimization, and, (b) using declarative programming (which allows for clean decoupling and thus even greater reuse).
Objective-C lives because (as pointed out in another comment) your Mac OS programming life is much more difficult if you choose not to use it.
- btilly 17y agoAll of the benefits? Does it help you when using someone else's framework that you didn't write and can't control? That being the key benefit that he started with then repeated over and over again.
- lucifer 17y agoYes. http://eclipse.org/aspectj/doc/released/progguide/index.html http://eclipse.org/aspectj/doc/released/progguide/index.html
- btilly 17y agoThe whole manual isn't exactly a lot of help since I don't know what I am supposed to be looking for in there. As a concrete example, can you walk me through how you can take a function that expects to receive objects of a specific class, and instead give them objects of another class? In particular imagine that you are implementing something like NSProxy, and are replacing objects that had lived locally with distributed objects that now exist on a different machine that you access with remote code calls. The objects have to be usable within a framework that is expecting the original kind of object, and you do not have access to source code or the ability to recompile. Thanks.
- lucifer 17y agoI didn't realize you expected a tutorial in aspect orientation! The gist: byte codes are transformed ("weaved") on load. Its irrelevant whether you have the source or not. http://my.safaribooksonline.com/0596006543/aspectjckbk-CHP-18-SECT-6 http://my.safaribooksonline.com/0596006543/aspectjckbk-CHP-1...
- btilly 17y agoNot necessarily a tutorial. However in response to a specific question I would hope for a specific pointer on how you might do that specific thing. The link you gave me the second time was far more helpful for re-evaluating aspect-oriented programming's capabilities in this regard than the manual. In particular I am now convinced that it can do things that I had not previously realized were possible.
- lucifer 17y agoTheoretically, aspect orientation can even reach inside the code that is being modified: join points can include loops and branches, but aspectJ does not provide that functionality. Anyway, the point that I was making is that virtual method dispatch coupled with virtual machines afford the possibility of models of indirection that are more efficient, more expressive, and formally declarable.
- allertonm 17y agoIf that were true, surely the Mac world would be dominated by Java applications written using AspectJ and the Java-Cocoa bridge? As it turns out, that didn't happen - and not because Apple didn't try pushing Java as a Cocoa development language. What happened was users pushed back on slow launching, memory hungry Cocoa-Java apps. So another reason for Objective-C's success is that yes, it does all the things the original article states, but it also does them in an Ahead-Of-Time compiled, non-Virtual-Machine language - and that combination is pretty unique. My suspicion is that Obj-C's unique combination of features plays a large part in NeXT/Apple's success in producing a set of frameworks that are high-level enough to allow for rapid development, but are also able to create responsive applications on the desktop AND be able to scale down to mobile devices.
- jimbokun 17y ago"My suspicion is that Obj-C's unique combination of features plays a large part in NeXT/Apple's success in producing a set of frameworks that are high-level enough to allow for rapid development, but are also able to create responsive applications on the desktop AND be able to scale down to mobile devices." This does not get nearly enough attention when people think about the successes Apple has had over Microsoft since OS X. The sweet spot of a fast, compiled, dynamic language and tools built to leverage those strengths gives Apple a lot of flexibility and productivity in design and implementation, from the OS level to the GUI tool kit level. I think that where Microsoft increasingly found themselves pushing a ball of mud uphill with the Windows code base, Apple was able to do a lot of clever things with their software stack without changing the underlying design and architecture. Like porting their PC OS to a cell phone and allowing their developers to leverage much of their existing skills to make apps for it. During Jobs' Nexodus, the NextStep environment became the main product because it was such a productive way to build software. With the return to Apple, it stopped being the product and started becoming a competitive advantage.