cancel
Showing results for 
Search instead for 
Did you mean: 

Model Instance Vs Model Object

Former Member
0 Kudos

Hi experts

can anyone plz explain me the difference between model instance and model objects. is it necessary to create model instance when dealing with WebService model.

also tell me what do u mean by associating model objects.

plz explain with reference to the following code :

<b>public void wdDoInit() {

//@@begin wdDoInit()

// create a new model instance (1)

model = new EmailAdWSModel();

// create model objects (2, 3)

Request_SendEmail requestMO = new Request_SendEmail(model);

SendEmail emailMO = new SendEmail(model);

// associate model objects (4)

requestMO.setSendEmail(emailMO);

// bind executable model object to context node (5)

wdContext.nodeRequest_SendEmail().bind(requestMO);

//@@end

}</b>

i found this on sample exercises given on sdn:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/301ff0bb-74ca-2910-fa99-eae39269...

can any one help me regarding this.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi krishnan..,

To be brief , have a clear idea about model i.e., A model contains number of classes inbuilt in it which u could find after importing a model..

You must create an instance to the model to access the classes in the model..

similarly you create objects to the classes in the model to get it referenced..

As u are used to object oriented programming, i hope u may have a good idea about classes and objects..

An object is always an instance of a class..and u can never access a class without creating an object to the class..

as in the coding which u have given..

"model" is an instance of the model called EmailAdWSModel();

then u create objects for the classes inside the model and then u access the attributes by referencing the objects of the class.

hope u would be clear with this concept

Former Member
0 Kudos

thanks kartikeyan

points awarded to u.

Former Member
0 Kudos

so can a model have multiple instances ?

Former Member
0 Kudos

hi krishna,

it is also possible to create multiple instances for a model if necessary..