You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Akshay Kapur <ak...@cisco.com> on 2003/04/24 21:17:05 UTC

Regards Screen Class Design

Hello!

I would like your suggestion/ recommendation/ opinion on the design 
technique I have used below:-

Requirement -
The concept is that the screen class Basic.java invokes some basic biz 
logic and puts data into context to display the screen.
Applications 1 and 2 re-use all of the biz logic as well as the screen 
painting logic in Basic.java and add some more logic specific to their 
application.

The package/file structure in my application is as follows -
     services/Basic.java extends services.SecureScreen
     app1/EnhanceBasic.java extends app1.SecureScreen
     app2/Enhance.java extends app2.SecureScreen

This is how I implemented this requirement -
Somewhere within the doBuildTemplate() of EnhanceBasic.java files, I have 
added this code -

public class EnhanceBasic.java extends SecureScreen
{
     ...
     Basic basic = new Basic();
     basic.doBuildTemplate( data, context );
     ---
}

As you can see, I am building the EnhanceBasic.java files literally "on 
top" of Basic.java!
This trick works well but I am concerned that I am explicitly instantiating 
a screen class and then invoking it's method. Is this appropriate or crazy? 
Am I missing any finer "servlet" related issue?

Thanks and Regards,
Akshay Kapur


Re: Regards Screen Class Design

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Akshay Kapur <ak...@cisco.com> writes:

>As you can see, I am building the EnhanceBasic.java files literally "on 
>top" of Basic.java!
>This trick works well but I am concerned that I am explicitly instantiating 
>a screen class and then invoking it's method. Is this appropriate or crazy? 
>Am I missing any finer "servlet" related issue?

If it's a screen class you might be able to use the Screen loader to
pull the screen from the AssemblerBroker Service.

In any case you should use the CacheService so you don't have to build
new Basic() objects again and again.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org