sca-j message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [sca-j] NEW ISSUE: Problems with Example 3 in chapter 7
- From: Yang Lei <yanglei@us.ibm.com>
- To: Simon Nash <oasis@cjnash.com>
- Date: Mon, 9 Feb 2009 10:35:42 -0500
Hello Simon,
Please have a look of the proposal I put for Issue 27. I made the some changes in the area by:
adding a new method to the interface and implementation
@PermitAll
public float getCurrencyFromUSD(float value){
Return fromUSDollarToCurrency(value);
}
Making the fromUSDollarToCurrency an internal method...
I also cleaned up formUSDollarToCurrency to remove the elses
float fromUSDollarToCurrency(float value) {
if (currency.equals("USD")) return value;
if (currency.equals("EURO")) return value * 0.8f;
return 0.0f;
}
Thanks.
Thanks.
Regards,
Yang Lei
WebSphere SCA Feature Pack Development -- SCA Architect
Phone: (919) 543 8887 T/L 441-8887
e-mail: yanglei@us.ibm.com
SCA Feature Pack: http://washome.austin.ibm.com/xwiki/bin/view/SCA2Team/WebHome
RTP Technical Vitality: http://swgcomm.bluehost.ibm.com/siteFiles/labs.html?location=SEUS&type=cluster
WebSphere Lab Advocate for Royal Bank of Scotland
Simon Nash <oasis@cjnash.com>
Simon Nash <oasis@cjnash.com>
02/09/2009 10:22 AM
|
|
TARGET: Java Common Annotations and APIs
DESCRIPTION: Problems with Example 3 in chapter 7
There are a number of problems with Example 3 in section 7.6.2.1
of cd02-rev2.
a. The fromUSDollarToCurrency method is not declared in the
AccountService interface. It only appears in the
implementation class. It appears that this omission is
accidental, not deliberate.
b. The calls from getAccountReport() to fromUSDollarToCurrency()
don't use SCA; they are just plain Java calls. It appears
they were intended to be SCA calls.
c. The code in getAccountReport() has excessive detail and is
poorly formatted. This makes it hard to understand the
point of the example.
d. The code in fromUSDollarToCurrency() has some "return"
statements followed by "else", with unusual formatting.
There is no need for "else" after "return".
PROPOSAL:
Add the fromUSDollarToCurrency method to the AccountService
interface.
Change the calls from getAccountReport() to fromUSDollarToCurrency()
into SCA calls, using the ComponentContext.getSelfReference() method.
Remove unnecessary detail from getAccountReport() and improve
its formatting.
Remove redundant "else" clauses from fromUSDollarToCurrency() and
improve its formatting.
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]