Tuscany BigBank Sample Application

Overview

The Tuscany BigBank sample application  shows using the Tuscany SCA runtime to build a  financial application.

Location

This sample is located in the sampleapps\bigbank directory. There are two subdirectories in that for the two modules account and webclient.

Setup

This Setup section is not required if you are working from a binary distribution. Set up your server as described in the Tomcat Setup.  If you are building the sample from source you need to deploy the war files produced in sampleapps\bigbank\account\target and sampleapps\bigbank\webclient\target  your webapp directory.

Running

Once you've started your web server, use your web browser to view the following URL http://localhost:8080/sample-bigbank-webclient/
You can either use an already supplied account with Login as test and Password as password, or you can  create a new account.
The demo is first configured to use a local mock stock quote service that returns random stock data.  If you want to use an actual stock quote provider follow these steps:
The sample should now be using the real stock quote provider. The "sca.fragment" file is loaded and added to the sca.module at runtime.

Introduction

This example illustrates using Tuscany runtime in building a financial application using SCA programing model.  The following key concepts are covered: BigBank sample provides the following user services: account balance, making deposits and withdrawals  to purchase and sell stock, and to view current stock value.
The sample is organized into two SCA modules: webclient and account. The webclient module functionality is to provide user information and obtain user input. The account module is is used to retrieve and store user information, account information, current stock information and the purchasing and selling of stock. The two modules interact via web services through SCA exterenalService and entryPoint.

Overview of modules.

Webclient


Webclient files 
click to enlarge
Java source files implementing SCA components and interfaces.
AccountServiceComponentImpl.javaImplements the account service.
AccountLoginServiceImpl.javaImplements the Logiin service.
LoginService.javaInterface for a services provided by a login  service component.
ProfileService.javaInterface for a service provided by a profile component.
ProfileServiceImpl.javaImplements the profile component.
SimpleLoginServiceImpl.javaA simple in memory login service.
Java source files implementing Web HTML interface.
AccountStatusTag.javaImplements a jsp tag that displays the account information
StockStatusTag.javaImplements a jsp tag that displays the stock information.
LoginBarrierTag.javaImplements a jsp tag that ensures the user is logged in.
ServiceTag.javaPlaces an SCA service in the JSP page context.
FormServlet.javaProcess user input and uses the AccountService component.
LoginServlet.javaProcesses logging in and logout.
Files that will be loaded as resources along classpath.
sca.moduleSCA  module. 
sca.subsystemSCA subsystem.
AccountService.wsdlWSDL that  defines the account service.
bigbank-tags.tldDefines the tag libs for the user interface.

Account

Webclient files 
click to enlarge
Java source files implementing SCA components and interfaces.
AccountServiceImpl.javaImplements the account service component.
AccountDataService.javaInterface defined for component implementing  an account's data service.
AccountDataServiceDASImpl.javaA Data Access Service (DAS) implementation of of the Account Data Service.
AccountDataServiceImpl.javaA Data Service implementation not using DAS.
AccountDBInit.javaA utility to just create the database and it table and fill in some initial data.
StockQuote.javaA class to hold the StockQuote information.
StockQuoteService.javaInterface defined for a component implementing a stock quote service.
StockQuoteServiceImpl.javaImplements a fake stock quote service.
StockQuoteWebservicexServiceImpl.javaImplements an actual stock quote service.
Files that will be loaded as resources along classpath.
AccountService.wsdlWSDL that  defines the account service
stockquotes.webservicex.wsdlActual stock quote service.
DasAccountConfiguration.xmlProvides any needed configuration info including datasource properties, table definitions,
sca.moduleSCA module.
sca.fragrmentLoaded and combined with the existing SCA module.
sca.subsystemProcesses logging in and logout.