The Artima Developer Community
Sponsored Link

Java Answers Forum
How to flatten the hook hierarchy when using Generic Template Class patter

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Stefan Illgen

Posts: 1
Nickname: stefan82
Registered: Aug, 2008

How to flatten the hook hierarchy when using Generic Template Class patter Posted: Aug 25, 2008 12:58 AM
Reply to this message Reply
Advertisement
Hi everyone,

my professor told me, that it's possible to flatten the hook hierarchy using the Generic Template Class pattern. but how? i can't see...

an implementation of this pattern looks like this:

public class TemplateClass<T extends Hook>{
   private T;
   public void templateMethod(){
      //alg
      t.hookMethod();
      //alg
   }
}
 
//hook hierarchy
public abstract class Hook{
   public abstract void hookMethod();
}
public class HookA extends Hook{
   public void hookMethod(){...}
}
public class HookB extends Hook{
   public void hookMethod(){...}
}


has anyone any ideas?

thank you in advance
stefan

Topic: generic method unchecked cast problem Previous Topic   Next Topic Topic: Controlling Access to Class Members

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use