BOFactory

Questa interfaccia fornisce la capacità di creare un grafico business o un oggetto business.

Scopo

Sono presenti tre modelli tipici utilizzati per la creazione di un grafico business o un oggetto business con l'interfaccia BOFactory:
  • Factory Create - Utilizzato per creare un oggetto dati indipendente di un grafico di dati esistente.
  • Containment Create (containment attach inferred) - Utilizzato per creare un oggetto dati child di un oggetto dati esistente.
  • Factory Create/Containment Attach - Utilizza un meccanismo di creazione di produzione per creare un oggetto business collegato ad oggetti business utilizzando il metodo DataObject.setDataObject().

Esempi

Questo esempio illustra varie opzioni diverse per il modello di creazione Factory Create.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOType typeService = (BOType) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOType");

// 1. Utilizzare il modello Factory Create dell'oggetto business con uno spazio dei nomi di destinazione
// e un nome di definizione di tipo complesso.
DataObject productCategory1 = factoryService.create
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory");

// 2. Utilizzare il modello Factory Create dell'oggetto business con il tipo.
DataObject productCategory2 = factoryService.createByType(typeService.getType
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory"));

// 3. Utilizzare il modello Factory Create dell'oggetto business con la classe.
DataObject productCategory3 = factoryService.createByClass
		(com.scm.pc.model.Product.class);
// Utilizzare il modello Factory Create del grafico business con uno spazio dei nomi di destinazione
// e un nome di definizione di tipo complesso.

// Inoltre, crea automaticamente le intestazioni ChangeSummary e EventSummary.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG", 
	                  "ProductCategoryBG");

Questo è un esempio del modello Crea contenitore.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");

// Utilizzare il modello Factory Create per l'oggetto di livello superiore.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG", 
	                  "ProductCategoryBG");

// Utilizzare il modello Containment Create sugli oggetti contenuti.
DataObject productCategory = productCategoryBG.createDataObject
		("productCategory");
DataObject product = productCategory.createDataObject("product");

Di seguito è riportato un esempio del modello Factory Create/Containment Attach.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
// Utilizzare il modello Factory sull'oggetto di livello superiore.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
// Utilizzare il modello Factory Create su ciò che diventerà alla fine un oggetto contenuto.
DataObject productCategory = factoryService.create
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory");
// Containment attach
productCategoryBG.setDataObject("productCategory", productCategory);
Riferimenti correlati
BOChangeSummary
BOCopy
BODataObject
BOEquality
BOEventSummary
BOType
BOTypeMetadata
BOXMLDocument
BOXMLSerializer
Informazioni correlate
API BOFactory interfaccia

Terms of use |

Last updated: Thu Apr 06 14:28:02 2006

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)