Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing and Deploying Business Components using PowerJ.

Similar presentations


Presentation on theme: "Developing and Deploying Business Components using PowerJ."— Presentation transcript:

1 Developing and Deploying Business Components using PowerJ

2 2 Developing and Deploying Business components using PowerJ Powerpoint presentation: http://www.sybase.com/products/eastudio/seminar_info.html under “Presentations” see “Phase II” and download: EAServer 3.0 Overview and Building Components in PowerJ 3.0 (zip file) Greg Burns - Technical Evangelist Sybase Internet Applications Division greg.burns@sybase.com

3 3 Build the Future - SyberSeminar Series 1. Building a shopping cart application with the Web DataWindow 2. Developing Business Components with PB 3. Developing Business Components in Java with PowerJ 4. Load Balancing Failover and High Availability 5. Implementing Web Security

4 4 eMusic Application Preview

5 5 Jaguar CTS JDBC ODBC Native E-Business Sybase Solution HTML COM PowerBuilder CORBA Java PowerDynamo HTTPS IIOP Enterprise Application Server CGI ISAPI NSAPI DataWindow Datastore

6 6 Why use Java on the Server for business logic components? l Multi-platform source code for business logic l Java is a productive language for software development l Commitment to developing in Java on all tiers l On the server high-powered hardware and non-visual programs combine to minimize any performance limitations of Java programs l Many corporations see Java programming as a way to attract and keep talented employees

7 7 l To efficiently manage Role of the Application Server Component instantiation and lifecycle Server

8 8 l To efficiently manage Database connections Role of the Application Server Component instantiation and lifecycle Transactions Server

9 9 l To efficiently manage Database connections Role of the Application Server Component instantiation and lifecycle Transactions Threads Server

10 10 l To efficiently manage Database connections Role of the Application Server Component instantiation and lifecycle Transactions Threads Security Server

11 11 Creating a Java EA Server Component with PowerJ l Steps 1. Create a Jaguar Server Bean Java class 2. Code the Bean using Drag and Drop techniques 3. Deploy the component to Jaguar CTS

12 12 Jaguar Component Wizard Highlights TargetJarPackageBean Name l Set the Target, Jar, Package and Bean Name Interfaces l Specify any Interfaces to implement

13 13 Jaguar Deployment Wizard Highlights packagecomponent l Specify Jaguar CTS package and component names deployment classes l Specify the deployment classes life cycle l Define component life cycle characteristics transaction support l Define component transaction support characteristics

14 14 Component Life Cycle Characteristics

15 15 Instance Pooling l Allows a single component instance to service multiple clients l Benefits Greatest scalability Many clients share limited number of instances Instance Pool

16 16 Supporting Instance Pooling EJB Server Bean Methods l Activate Triggered when component is bound to client Used to (re)initialize instance-specific data l Deactivate Triggered when component is unbound from client Used for clean-up code

17 17 Instance Pooling l Goal Minimize amount of time an instance remains bound to a client (early deactivation) l Design strategies Stateful components Stateless components

18 18 Stateful Components l Maintain a state between method invocations l Store properties as instance variables l Expose methods to manipulate properties

19 19 Stateful Components setAmount(15000) Instance Pool

20 20 Stateful Components setAmount(15000) setMonths(24) calculate( ) return 725 Instance Pool 15000 24

21 21 Stateful Components Instance Pool

22 22 Disadvantages of Stateful Components in Large-Scale Systems l Lifetime Components have longer life (require resources) l Ownership Cannot be shared More instances must be created l Performance Larger number of RPCs across the network

23 23 Stateless Components l Stateless components cannot use instance-specific data to accumulate data between method invocations Do not retain information from one method invocation to the next Client passes needed information as parameters to the method

24 24 Stateless Components calculate(15000,24) Instance Pool

25 25 Stateless Components calculate(15000,24) return 725 Instance Pool

26 26 Stateless Components Instance Pool

27 27 Advantages of Stateless Components in Large-Scale Systems l Lifetime Shorter life optimizes resource usage l Ownership Can be recycled Number of instances to create is minimized l Performance Improved due to fewer RPCs across the network

28 28 Defining a Stateless Component Automatically l Deployment-time attribute l Instance automatically deactivated on method return

29 29 Defining a Stateless Component Programmatically l InstanceContext functions completeWork( ) rollbackWork( )

30 30 Define Component Transaction Support

31 31 Define Component Transaction Support l Multiple components can participate in a single transaction l Each component performs part of the overall task l Jaguar transaction management lets you group database updates performed by multiple components into a single atomic unit of work

32 32 Account 1 Example Teller Account 2 Transfer 1. Withdraw 2. Deposit Log 3. Write

33 33 What is the Scope of the Transaction? Option 1 l Withdraw l Deposit l Write to log

34 34 What is the Scope of the Transaction? Option 2 l Transaction 1 Withdraw Deposit l Transaction 2 Write to log

35 35 Account 1 Option 1 Teller Account 2 Transfer 1. Withdraw 2. Deposit Log 3. Write

36 36 Account 1 Option 2 Teller Account 2 Transfer 1. Withdraw 2. Deposit Log 3. Write

37 37 Starting to create an EAServer component in PowerJ l Bean Wizard l Jaguar server component

38 38 Jaguar Component Wizard Outcome l Java Classes eMusicJ.CartJ.java eMusicJ.CartJInterface.java ServerBean interface implementation code Form for design time coding of Non Visual objects

39 39 Step 2: Coding the Component l activate() l deactivate() l retrieve( ) l update( )

40 40 Activate transaction_1.connect(); state = parm0;

41 41 Connection Caching l Components share pools of preallocated connections to remote database servers Connection Cache IIOP

42 42 Deactivate transaction_1.disconnect();

43 43 Retrieve( ) byte [ ][ ] state = new byte [1][ ]; ds_1.retrieve(); ds_1.getFullState(state); return state[0];

44 44 Update( byte[ ] state ) ds_1.setFullState( state );

45 45 Step 3: Deploy the Component l Configure PowerJ deployment options l EAServer deployment wizard

46 46 HTML Creating a Client Application COM PowerBuilder CORBA Java Enterprise Application Server

47 47 Creating a PowerJ Client Application l Step 1: Create a new Application using the new Target Wizard l Step 2: Create PowerJ Proxies l Step 3: Drag and Drop InitialContext component and proxy then code the Application

48 48 Step 1: Target Wizard l Creates new Client main form

49 49 Step 2: Create PowerJ Proxies l Proxies for any kind of component can be created PowerBuilder Java COM C/C++

50 50 Step 3: Add InitialContext component and proxy then code the application 1. Initialize Connection and Proxies 2. Invoke Server Component's Methods

51 51 1. Initialize Connection and Proxies

52 52 2. Invoke Server Component's Methods l Retrieving data byte [ ] state; state = cartj_1.retrieve( ); dw_customer.setFullState(state) l Updating data dw_customer.getFullState(state) cartj_1.update(state)

53 53 Summary


Download ppt "Developing and Deploying Business Components using PowerJ."

Similar presentations


Ads by Google