BOFactory

이 인터페이스는 비즈니스 그래프 또는 비즈니스 오브젝트를 작성하는 기능을 제공합니다.

용도

BOFactory 인터페이스를 사용하여 비즈니스 그래프 또는 비즈니스 오브젝트를 작성하는 데 사용되는 세 가지 일반 모델이 있습니다.
  • 팩토리 작성 - 기존 데이터 그래프와 관계 없이 데이터 오브젝트 작성에 사용됩니다.
  • 포함 작성(포함 첨부 가정) - 기존 데이터 오브젝트의 하위 데이터 오브젝트 작성에 사용됩니다.
  • 팩토리 작성/포함 첨부 - DataObject.setDataObject() 메소드를 사용하여 비즈니스 오브젝트 그래프에 첨부되는 비즈니스 오브젝트 작성에 팩토리 작성 메커니즘을 사용합니다.

다음 예는 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. Use the business object Factory Create model with a target namespace
// and a complex type definition name.
DataObject productCategory1 = factoryService.create
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory");

// 2. Use the business object Factory Create model with the type.
DataObject productCategory2 = factoryService.createByType(typeService.getType
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory"));

// 3. Use the business object Factory Create model with the class.
DataObject productCategory3 = factoryService.createByClass
		(com.scm.pc.model.Product.class);
// Use the business graph Factory Create model with a target namespace
// and a complex type definition name.

// It also automatically creates the ChangeSummary and EventSummary headers.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG", 
		"ProductCategoryBG");

다음은 Containment Create 모델의 예입니다.

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

// Use the Factory Create model for the top level object.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG", 
		"ProductCategoryBG");

// Use the Containment Create model on the contained objects.
DataObject productCategory = productCategoryBG.createDataObject
		("productCategory");
DataObject product = productCategory.createDataObject("product");

다음은 Factory Create / Containment Attach 모델의 예입니다.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
// Use the Factory Create model on the top level object.
DataObject productCategoryBG = factoryService.create
		("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
// Use the Factory Create model on what will eventually become a contained object.
DataObject productCategory = factoryService.create
		("http://www.scm.com/ProductCategoryTypes", "ProductCategory");
// Containment attach
productCategoryBG.setDataObject("productCategory", productCategory);
관련 참조
BOChangeSummary
BOCopy
BODataObject
BOEquality
BOEventSummary
BOType
BOTypeMetadata
BOXMLDocument
BOXMLSerializer
관련 정보
인터페이스 BOFactory API

Terms of use |

Last updated: Thu Mar 23 18:54:58 2006

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