On 8/13/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> Why not something like this:
> 
> interface MarkupLocationStrategy {
>    public String locate(Class page);
> }

I'm not a fan of the use of locate() here, it's already being used in
the ResourceStreamLocator to find a resource by name from some
locations.

It might be better to rework the interface:

interface MarkupNameResolver {
  public String resolve(Class page);
}

with its default impl:

class FqcnMarkupNameResolver {
  public String resolve(Class page) {
    return page.getClass().getName();
  }
}

and the other impl:

class ShortClassNameMarkupNameResolver {
  public String resolve(Class page) {
    String className = page.getClass().getName();
    return className.substring(className.lastIndexOf('/'), className.length());
  }
}

Then it's easy to add another Path to search for resources, when you
want markup to live in places such as /WEB-INF/html.

Seth


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to