Ranjan Sarma
Ranjan Sarma

Reputation: 1595

Writing reusable codes in xquery and starting xquery / marklogic

I am a starter in Marklogic and Xquery.


1. I wanted to know how to make object oriented programming modules (like class, interface etc) possible in xquery with marklogic.
2. Where to start from and is there any online resource that teaches tutorials like 'building my Hello World application in MarkLogic / XQuery'?


Any help is highly appreciated.

Upvotes: 0

Views: 270

Answers (2)

Wildus Billicus
Wildus Billicus

Reputation: 1

The most simple answer to your question: XQuery != JAVA

Upvotes: 0

grtjn
grtjn

Reputation: 20414

XQuery is not an OO, but mostly a functional language, so constructs like class and interface are not very obvious. It is very easy to write function libraries though, just put a module clause in the prolog. You can import such modules in other modules or in main modules (XQuery files that don't have a module clause).

MarkLogic does provide an interesting construct, which is the ability to pass functions around as arguments, and hold them in variables. XQuery 3.0 (partly supported by the latest version of MarkLogic) provides similar provisions like dynamic function calls, and inline functions.

About building typical and complete webapps with MarkLogic, there are quite a number of frameworks that can help you with that. There is runDMC, on which http://developer.marklogic.com is based. There is also roxy. You might also be interested in building REST api's in MarkLogic. In that case MarkLogic 6 has built-in features, and for older versions it is worth looking at Corona. These, as well as several tutorials and quite a number of blog posts are all available on http://developer.marklogic.com

HTH!

Upvotes: 1

Related Questions