• Welcome to KonaKart Community Forum. Please login or sign up.
 

deprecated new KKEng()

Started by Tim Davenport, July 02, 2009, 03:10:56 am

Previous topic - Next topic

Tim Davenport

Hi Alll     

We have a fairly heavily modified version of KK, and I am currently doing the upgrade from 2.2.6.0 to 3.2.0.0 and have noticed the deprecation of the KKEng() constructor.
     
we use the following code example all over the place to to get configuration items from the configuration table.

KKConfiguration conf;
            KKEng eng = new KKEng();

            conf = eng.getConfiguration("MODULE_PAYMENT_XXXXX_KEY");

...

order.setDivision(conf.getValue());

what is now best practice to get these configuration items?
bearing in mind not all of our classes that use these configuration items have an active KKAppEng (classes exposed as Web services )


Brian

As far as the creation of the engine is concerned...  use the KKEng(EngineConfig) constructor...  I think that's the only one that isn't deprecated..

  EngineConfigIf engConfig = null;
  eng = new KKEng(engConfig);

(This constructor wants an EngineConfigIf object, but a null EngineConfig will give you the defaults which will work OK in standard mode which I think you use - ie single store mode, not shared customers or shared products.   This wouldn't work if you were in a multi-store environment - in which case you would have to populate the EngineConfig appropriately).