aspose file tools*
The moose likes XML and Related Technologies and the fly likes  XML and aspect-oriented programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark " XML and aspect-oriented programming" Watch " XML and aspect-oriented programming" New topic
Author

XML and aspect-oriented programming

HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Can you do AOP with XML alone or do you need an AOP language?
regards
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Yes and no. AOP is a concept that could be implemented by means of writing advices in an XML-based scripting language. However, you'd still need an AOP engine/compiler for integrating that XML into your OO code, and I'm not aware of any.
You might wanna check out this thread at TheServerSide for a discussion about the state and future of Aspect-Oriented Programming.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Found this link Aspect Orientated Software Development
It's a case of taking your pick.
Smart Tools seems the only one using XML but this list may not be up to date.
regards
[ June 04, 2003: Message edited by: HS Thomas ]
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Did you ever want to change third-party Java classes but could not because you did not have their source code?
Then JMangler is the tool for you!

Thought it was only a bad choice of name.
regards
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Lasse,
Thanks for the link.
From the Xdoclet site :
J2EE Made Easy. XDoclet's advanced code generation features makes it easier to code J2EE applications. You write the enterprise bean implementation and XDoclet generates interfaces, value objects, struts forms and much, much more for you. XDoclet follows many widely recognized J2EE patterns.

Xdoclet is apparently Aspect - Orientated.
Any chance that it can be used to generate a GUI ? It seems to be able to do pretty much everything else.
regards
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by HS Thomas:
Any chance that it can be used to generate a GUI ? It seems to be able to do pretty much everything else.

The XDoclet.org site doesn't advertise a GUI generator plugin and when you think of it, are javadoc tags in a source file really suitable for depicting "what kind of a GUI should be generated for a Java class"?
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
are javadoc tags in a source file really suitable for depicting "what kind of a GUI should be generated for a Java class"?

Probably not. But then why not, if you can use HTML tags , JSP tags to do the same ?
My thinking is as follows:

  • Aspect Orientated Programming enables multiple separation of concerns
  • XDoclet is Aspect Orientated
  • Model-View-Controller pattern also enables some separation of concerns which good GUIs follow
  • Therefore use XDoclet to get an Aspect Orientated GUI (Kind of a 3D- jigsaw puzzle with pieces that rotate to present an evolving view each time a piece is changed) .


  • I'm sure my thinking is flawed. I may be wrongly equating AOP with reverse engineering.
    A site showcasing many faceted products,skills,money exchanges, labour exchanges could have Aspect GUIs (selection boxes at decision points only saves designing in redundancy early , each time an aspect is changed saves having to go back to the Main Menu to start all over again) , Aspect money (real money or a labour credit note or select club vouchers) etc generated.
    I'll think of a better example
    Now I'm stumped.
    regards
    [ June 05, 2003: Message edited by: HS Thomas ]
    Lasse Koskela
    author
    Sheriff

    Joined: Jan 23, 2002
    Posts: 11962
        
        5
    It could be just my lack of imagination but the only way I can think of to generate GUI code with a doclet is some kind of a CRUD application (create retrieve update delete) for a JavaBean.
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Well,
    I started thinking that perhaps a Game would be a better example.
    Then I remembered the venerable
    James Conway's Game of Life.
    Without getting too philosophical are there any parallels with AOP ?
    The AOP GUI would be the everchanging yellow patterns which have some meaning to my mind.
    Applications - Some kinds of systems/business monitoring applications
    regards
    P.S.
    the only way I can think of to generate GUI code with a doclet is some kind of a CRUD application (create retrieve update delete) for a JavaBean

    Thanks for the tip, Lasse. I'll take a closer look at XDoclets.
    [ June 05, 2003: Message edited by: HS Thomas ]
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Correction!. Aspect OP enables
    the clean modularization of crosscutting concerns such as: error checking and handling, synchronization, context-sensitive behavior, performance optimizations, monitoring and logging, debugging support, multi-object protocols

    which is quite different from:
    "multiple separation of concerns".
    It's the context-sensitive behaviour that interests me in my application/game.
    Lasse, your idea about using a Bean seems appropriate .As in EJBs , a single Bean class can generate multiple EJBs, so it could GUIs (?) ,and I believe Web Services and almost anything.
    A specific tool is needed for each specific generation.

    Therefore the mapping stage reduces to an XML to XML transformation. In simple cases this mapping can be done efficiently enough with XSLT; in more realistic cases the XSLT needs to be cross-compiled with more traditional languages (e.g. with Java, using XSLTC).

    Would XSLTC help as the AOP engine/compiler for integrating that XML into your OO code?
    regards
    [ June 07, 2003: Message edited by: HS Thomas ]
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Anyone ?
    Or a variation of XSLTC, or JAXB ?
    regards
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Adding to the list :
    WebWork
    Interestingly, Rickard also helped initiate XDoclet.
    regards
    [ June 08, 2003: Message edited by: HS Thomas ]
    Valentin Crettaz
    Gold Digger
    Sheriff

    Joined: Aug 26, 2001
    Posts: 7610
    There is an interesting discussion going on theserverside.com on this topic.
    Check it out at http://www.theserverside.com/discussion/thread.jsp?thread_id=18878


    SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
    [Blog] [Blogroll] [My Reviews] My Linked In
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Thanks for the link, Valentin.

    Seems there are so many different angles from which you can apply aspects.
    I have to look at it once again. But I suspect XML and related technologies will be my best bet.
    regards
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Having said that , the following comment from the link you supplied makes a lot of sense.
    Posted By: Tom Sedge on April 16, 2003 @ 02:42 AM in response to Message #79949.
    XML is markup - use it to express and communicate data, don't program with it (look at the mess that is XSLT if you don't believe this)
    * Java is general purpose - program with it, but don't script or communicate with it
    * Python/Ruby/etc.. - script or program with it, but don't communicate with it
    * Aspects are a form of programming, not markup - so put them in the language, not XML

    regards
    Valentin Crettaz
    Gold Digger
    Sheriff

    Joined: Aug 26, 2001
    Posts: 7610
    That makes a lot of sense, indeed
    I agree with
    XML is markup - use it to express and communicate data, don't program with it (look at the mess that is XSLT if you don't believe this)
    XSLT is a very good example, but so is the WATER language.
    Just by looking at the Quick reference guide should give you an idea about how you go about "programming" with the WATER language...
    I don't say WATER is bad, I just say it is unnecessary to go into such a syntactic-hell... XML is just not meant for doing that kind of things.
    [ June 17, 2003: Message edited by: Valentin Crettaz ]
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Re-visiting an old post :
    Water is a dynamic language that unites the worlds of objects and Web Services in an elegant way.

    Seems very powerful, if used properly.
    Could it be used as a bridge between
    BPEL ----> Water language ----> OO language ?
    Good for component based development, for example, in building a kit architecture from which to build your components ?
    There are somethings you really don't want to be doing repetitively.
    Write your classes or sets of classes in the OO language first. Then with the Water language's keywords mapped to the classes/ suites of classes
    you just build components from there...and associated test classes.
    I am not sure if this concept has any relation to advices in AOP.
    What is a good reference for this?
    I think it is workable from a component-based point of view. :roll:
    regards
    [ July 02, 2003: Message edited by: HS Thomas ]
    HS Thomas
    Ranch Hand

    Joined: May 15, 2002
    Posts: 3404
    Tight Coupling ;the REST architecture which WATER is similar to.:-

    Manageability
    Hmmm..
     
     
    subject: XML and aspect-oriented programming