Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

TAFJ-D e p r e c a ti o n

M e c h a nis m
R18
TAFJ D e p r e c a ti o n M e c h a ni s m

Amendment History:

Revisio
Date Amended Name Description
n

1 March 10th 2017 T. Aubert Initial version

Page 2
TAFJ D e p r e c a ti o n M e c h a ni s m

Copyri g h t
Copyright (c) 2014 TEMENOS HOLDINGS NV
All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.

Errat a and Com m e n t s


If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department

Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland

Tel SB: +41 (0) 22 708 1150


Fax: +41 (0) 22 708 1160

Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com

Page 3
TAFJ D e p r e c a ti o n M e c h a ni s m

Table of Contents
Copyright................................................................................................................................................ 3
Introduction............................................................................................................................................. 5
The benefits............................................................................................................................................ 5
The Deprecation LEVELs....................................................................................................................... 5
Environment for deprecation................................................................................................................... 6
Deprecating a Keyword (TAFJ Development)........................................................................................ 7
Deprecating a Method (JBC Developer)................................................................................................. 8

Page 4
TAFJ D e p r e c a ti o n M e c h a ni s m

Intro d u c t i o n
Most of the programming languages have a notion of deprecation. JBC is not an exception
and is offering such a mechanism as well.

However, simply deprecating keywords is not sufficient. This document will explain how this
is possible to deprecate methods (in .component) as well as keywords. This will also
describe the implications of a deprecation.

The be n e f i t s
Deprecation is a nice and auto-describing aproach for making an environment evolving.
Since this is a low-level feature, every single developer is immediatelly impacted by a
deprecation and can (has to) act accordingly. This is a binary approach (all or nothing) which
guaranty a full embracement of new features.

The Depr e c a t i o n LEVELs


Unlike most of the deprecation mechanism, JBC is offering a “LEVEL” of deprecation. This
means, this is possible to deprecate something with a “WARNING” level or an “ERROR”
Level. A “WARNING” level will have no other effect of warning the developer immediatelly
when this last is using something deprecated. However, a “ERROR” level will have as effect
to fail the compilation. Normally, this “ERROR” level is not necessary as usually, this is the
equivalent of simply removing the deprecated method / keyword. However, because of the
need to stay back-compatible with all the development having been made all over the world
in JBC, this “ERROR” level will only affect specific development teams / environment (see
next chapter)

Page 5
TAFJ D e p r e c a ti o n M e c h a ni s m

Enviro n m e n t for depr e c a t i o n


Because this is not possible to break back-compatibility, the deprecation mechanism is only
active in the Eclipse (IDE) environment, and only for projects being flagged as “internal”. This
means that only T24 Internal development are concerned by this facility. As a reminder,
defining a project as “internal” is done in the IDE by right-clicking on the Project →
Properties → TAFJ → Compiler

Page 6
TAFJ D e p r e c a ti o n M e c h a ni s m

This option is mandatory for Temenos Internal development (otherwise this is not possible to
deliver the code in Source control). Note that this option “can” be activated for L3
development, but is not mandatory.

Page 7
TAFJ D e p r e c a ti o n M e c h a ni s m

Depr e c a t i n g a Keyw or d (TAFJ Dev e l o p m e n t )


This chapter is only for TAFJ Core development. It is describing how to deprecate a JBC
Keyword.

Deprecating a keyword is very easy and needs (logically !) to be done in the TAFJCompiler
project.

Simply add the Token (Keyword) with the addToken as described bellow.

The constructor of the DeprecatedToken takes 3 parameters :

String : Name of the Token (eg “OCONV”, “MATCHES”, …)

DeprecatedToken.LEVEL : WARNING | ERROR

String : FreeText to describe a replacement. Can be null.

As an example, imagine those two token deprecated.

package com.temenos.tafj.basic;

public class DeprecatedTokens extends HashMap<String, DeprecatedToken> {


/**
* Populate the list of token you want to deprecate here. This will have an
* immediate effect on the Editor and the Compiler.
*/
private void populate() {
addToken(new DeprecatedToken("OCONV", DeprecatedToken.LEVEL.WARNING, "TC.Core.NewOConv(...)"));
addToken(new DeprecatedToken("ICONV", DeprecatedToken.LEVEL.ERROR, "TC.Core.NewIConv(...)"));
}

...

As a result, in the IDE (Eclipse), the developer will have this :

And the error (or warning) message issued from the 3rd parameter of DeprecatedToken :

Page 8
TAFJ D e p r e c a ti o n M e c h a ni s m

Page 9
TAFJ D e p r e c a ti o n M e c h a ni s m

Depr e c a t i n g a Met h o d , Prop e r t y , Tabl e or


Con s t a n t (JBC Dev e l o p e r )
This chapter concern all JBC Developer. This shows how to deprecate a Method, Property,
Table or Constant defined in a .component file.

Let’s use the method GetPropertyRecord(…) of the component


AA.ProductFramework.component

The definition looks like this :

/*
* Some com m e n t s
*/
publi c me t h o d GetP ro p e r t y R e c o r d (
INOUT Templat e stri n g ,
INOUT IdInfo stri n g ,
...
)
{
jBC : AA.GET.PROPERTY.RECORD
}

To deprecate it, add, right before the definition of the method (after the hypothetic comments)
the @Deprecated information like this :

/*
* Some com m e n t s
*/
@Depr e c a t e d
publi c me t h o d GetP ro p e r t y R e c o r d (
INOUT Templat e stri n g ,
INOUT IdInfo stri n g ,
...
)
{
jBC : AA.GET.PROPERTY.RECORD
}

. . . and Save. This is it !

Note that this is the same for a Property, a Table or a Constant.

Page 10
TAFJ D e p r e c a ti o n M e c h a ni s m

The result will look like the same as for the keywords :

The message is very minimum, and you can enrich it by specifying a replacement by putting
it after “:” in the Annotation.

Example, by specifying this annotation :

/*
* Some com m e n t s
*/
@Depr e c a t e d : GetN e w P r o p e r t y(...)
publi c me t h o d GetP ro p e r t y R e c o r d (
INOUT Templat e stri n g ,
INOUT IdInfo stri n g ,
...
The result will be :

Also, if you want this deprecation to have the ERROR level, you can spacify it in-between
brackets like this :

/*
* Some com m e n t s
*/
@Depr e c a t e d ( E RROR) : GetN e w P r o p e r t y(...)
publi c me t h o d GetP ro p e r t y R e c o r d (
INOUT Templat e stri n g ,
INOUT IdInfo stri n g ,
...
And the compilation will fail. Remember, only in the IDE and if “Internal Development”

Page 11

You might also like