Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Factory Example

Status
Not open for further replies.

marcob

Programmer
Joined
Aug 1, 2000
Messages
8
Location
IT
Hi,
could you please show me where I can get an example of a CORBA class factory use?
Marco
 
Ok at a high level:

Create a class called Bank. In this class have a method called createAccount which accepts a string and returns an object of type account. Register the bank object with the naming service and get a reference to it from your client app. Call the createAccount() method to return the class you require:

public class Bank{

public Bank(){

}

public Account createAccount(String name) {
Account myAcc = new Account(name);
myAcc.connect();
return myAcc;
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top