2009/4/16 David Pollak <feeder.of.the.be...@gmail.com>:
> Taking the discussion to the main list
>
> On Thu, Apr 16, 2009 at 10:23 AM, Jonas Bonér <jo...@jonasboner.com> wrote:
>>
>> 2009/4/16 David Pollak <feeder.of.the.be...@gmail.com>:
>> >
>> >
>> > On Thu, Apr 16, 2009 at 7:08 AM, Jonas Bonér <jo...@jonasboner.com>
>> > wrote:
>> >>
>> >> 2009/4/16 David Pollak <feeder.of.the.be...@gmail.com>:
>> >> > It'd be optimal if you could discuss the JTA stuff in the public
>> >> > forum.
>> >> >  In
>> >> > terms of AOP, I'm really not kidding that AOP is not going to happen
>> >> > in
>> >> > Lift.
>> >>
>> >> You don't like annotations? E.g. @Transactional etc.?
>> >
>> > I'm not keen on annotations, but I can live with them.
>> >
>> > I am firmly against anything that re-writes byte-code after the
>> > compilation
>> > phase for production code.  Once the Scala-Maven plugin supports
>> > compiler
>> > plugins, then there's a lot of stuff that can be done at compile-time.
>>
>> The AOP stuff I have done is based on dynamic proxies no bytecode munging.
>
> OKay... I need to see some example to fully understand why a proxy needs AOP
> rather than either (1) compile-time proxy generation or (2) the built-in
> Java reflect proxy thingy.

You can impl AOP using many different techniques. I proposed the
simplest one (used by Spring, Guice etc.). Using a regular JDK Dynamic
Proxy (which is the 'build in Java reflect proxy thingy'). What is
your question?

>> >
>> > So, what does AOP give us that can't be done at another phase?

AOP is not about a specific phase. It can be done at:
* compile time
* class load time
* runtime

Can be done with:
* Bytecode mods
* Generated proxy
* Dynamic proxy
* JVM-level hooks

>> >
>>
>> Semantics to annotations.
>
> Can you help out with an example?

Annotate a class with f.e.
@transactional(type=Required)  class Foo { ..}
and have all methods in this class being invoked under a transaction
with Required semantics

or annotate a specific method
@transactional(type=RequiresNew)  def foo { ..}
to get the same behavior for a method only

Annotations is the way most JEE devs are used to handle these things
since it is the approach both Spring, Guice, EJB 3 etc. etc. has
taken.

The stuff I have written allow using AspectJ pointcuts as well.
E.g. f.e. apply transactions to all methods in the service layer:
match('* com.biz.service.*(..)')

Or to a specific method:
match('void Store.buy(Item)')

But you could just use call-by-name:

transactional(TransactionType.Required) { // tx begin
  .. // do stuff in TX
}  // tx commit or rollback

But that pollutes the code, makes it harder to change, configure and
is not declarative.
Perhaps give the user options?

But you guys choose.
I am here to serve :-)

/Jonas

>
> Thanks,
>
> David
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>



-- 
Jonas Bonér | Crisp AB

http://jonasboner.com
http://crisp.se

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to