Java Reference
In-Depth Information
1.4 T he plot thickens
Although this simple example is useful to get some hands-on experience with the
IDE and to touch on a number of topics, it does nothing to help explore the
deeper features of the software. To that end, we require a much more detailed
project: not necessarily difficult, but complex enough to require the use of some
of IDEA 's more advanced features. Our discussions of those advanced features will
be accompanied by an example of that functionality in action as applied to our
running example.
1.4.1
Welcome to ACME Incorporated
Let's pretend that you're a staff engineer for the fictitious ACME Incorporated,
and you've been tasked with building a Java application. The system required is
responsible for providing currency exchange estimations based on exchange
rates obtained from an undefined service provider. The client application and
underlying implementation you provide must accept the user's request for
exchange rates or actual exchange transactions, leverage the underlying service
to determine the correct answer, and return those results to the end user. Some
sample use-cases and requirements include the following:
A user can request the exchange rate between two specified currency types
(for example, rate of exchange from U.S. dollars to Canadian dollars).
A user can request the conversion amount by specifying an amount in one
currency and the currency to be converted to (for example, $5 U.S. con-
verts to how many Canadian dollars?).
A user can request a list of the currencies known by the system.
The coupling to an exchange-rate service provider should be loose, so that
ACME can switch between rate providers at will without requiring source
code modification.
The interface for the exchange rate service will be provided to you. It rep-
resents a common interface used by most of the rate providers.
1.4.2
Starting the ACME project
The first thing you need, to begin work on this product, is a new IDEA project.
Select File | New Project to create a project representing the currency converter.
Follow the process we outlined earlier for the HelloWorld example, because the
two will be nearly identical for now. We'll return to the converter project defini-
tion to adjust it once you have more exposure to IDEA 's feature set.
 
 
 
 
 
Search WWH ::




Custom Search