|
||||||||||||||||||||||||||||||||||||
|
What is JavaMatch?JavaMatch is an engine that can search inside a runtime Java data structures, and look for objects that best match the criteria that you specify. JavaMatch is a generic match engine, not targeted at a specific domain. It can be applied to any runtime data structure, and the extensive query mechanism allows for highly customizable tuning of your searches. JavaMatch can be integrated with object- relational mapping tools. This allows you to match inside databases. FunctionalityJavaMatch's functionality compared to "normal" database searching can be described by using an analogy:
If you search for something in Google, you don't just see the pages that exactly
match your search query, you'll also get the results that best match the search
query (unless you use the "+"-syntax). Example: QueriesNice those stories, but how does it work in practice? Let me give you an example:
Let's suppose there is an application that keeps an inventory of used cars.
This application has a class Car, with methods getBrand(),
getPrice(), ... to retrieve the brand, price, .... QuerySet query = new QuerySet(); query.addRequired(new StringEquals("brand", "BMW")); query.addPreferred(new LessThan("price", 10000)); query.addPreferred(new Range("buildYear", 1997, 2002)); query.addPreferred(new LessThan("mileage", 80000)); List allCars = carData.getAllCars(); MatchResult matchResult = matchEngine.executeQuery(query, allCars); ResultsWhen you execute this query, the match engine might return objects with the following data:
As you can see in row 1 to 3, the match engine first returns the objects that exactly match the criteria. This is the same data that you get when you execute a similar SQL query. Row 4 to 6 are different: they show the objects that don't match exactly, but the objects that best match the query. What's more?The queries that you see in the example above are just a small subset of the queries that JavaMatch provides. In the documentation section, you'll find the following different kinds of queries:
Other features provided by JavaMatch are:
|
|||||||||||||||||||||||||||||||||||
Copyright © 2004, Walter van Iterson |