Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Deprecated createX(java.lang.Object... params) methods in IChartObjectFactory
 Post subject: Deprecated createX(java.lang.Object... params) methods in IChartObjectFactory Post rating: 0   New post Posted: Wed 21 Mar, 2012, 14:42 
User avatar

User rating: 6
Joined: Thu 19 May, 2011, 11:14
Posts: 235
Location: South Africa,
All methods of the form createX(java.lang.Object... params) in IChartObjectFactory seem to have been deprecated.

For examples:
  • <T extends IChartObject> T create(java.lang.Class<T> objectClass, java.lang.Object... args)
  • IShortLineChartObject createShortLine(java.lang.Object... params)
  • ISignalUpChartObject createSignalUp(java.lang.Object... params)
  • etc.
have all been deprecated.

Does this mean that a user wishing to avoid deprecated methods must necessarily instantiate all chart objects in a two-step process?:
  • create
  • move and set up properties
Is there a loss of efficiency compared to the deprecated methods?

For example, is...
line = createShortLine(key)
line.move(time,price);
line.setTime(1,time1);
line.setPrice(1,price1);

...just as efficient as the following deprecated code?...
line = factory.createShortLine(key, time, price, time1, price1);

...or is there another way to create an IShortLineChartObject in one shot that is not deprecated?


 
 Post subject: Re: Deprecated createX(java.lang.Object... params) methods in IChartObjectFactory Post rating: 0   New post Posted: Wed 21 Mar, 2012, 14:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
They were deprecated, because the signature gave no information about the expected parameters, which was both inconvenient and error-prone. With the next version of JForex-API, all of those methods will get replaced with methods that will accept the same parameters, but will have different signature (hence, for the existing strategies this should not cause errors in run-time), for instance:
createRectangle(java.lang.Object... params) 
will get replaced with:
createRectangle(String key, long time1, double price1, long time2, double price2);
and
createVerticalLine(java.lang.Object... params) 
will get replaced with:
createVerticalLine(String key, long time);
etc.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com