Application Inheritance

  2 posts   Feedicon  
Replies: 1 - Last Post: January 26, 2011 08:11
by: Juan Francisco Ara Monzón
showing 1 - 2 of 2
 
Posted: January 25, 2011 19:50 by Juan Francisco Ara Monzón
Hi there,

I've a small problem.

I had a subset of custom JPanles with some bindings and a custom architecture (they even have same super panel and even some @actions) and now I want to reuse them in other applications.

It's hard because of the architecture of BSAF and the way getApplication(....) is resolved but that's not a big issue, since I've been inheriting my old base application without too many problems. I know I could create a trunk in my repo and start there and much other alternatives but I had none. The only choice was to extend that application, reuse the panels, create a new view in the new application and pray that, in runtime, the new application can be casted to the old one Wink

But now, I've run into some problems with instantation within netbeans. If one component is dropped into another component, it's invalid because the Application static instance in Application is not the same class (class cast exception).

What I propose is, in Beans.isDesignTime();, at Application.getInstance(...) methods patch the following:

        //In desing time, always create new one.
        if (Beans.isDesignTime()) {
            try {
                return create(applicationClass);
            }
            catch (Exception e) {
                String msg = String.format("Couldn't construct %s", applicationClass);
                throw(new Error(msg, e));
            }
        }


 
Posted: January 26, 2011 08:11 by Juan Francisco Ara Monzón
I just tested that code and it works in netbeans without a hitch. Out of design time, the library is working as usual.

Will be possible to merge that changes into standard version?

Regards, J.
Replies: 1 - Last Post: January 26, 2011 08:11
by: Juan Francisco Ara Monzón
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close