Question
Cognizant
IN
Last activity: 14 Dec 2016 7:30 EST
difference between object and instance
difference between object and instance??
-
Like (0)
Venkata Naga Kiran Mavuri -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
A class is the "DNA" used to instantiate and later update an object.
A class can inherit "DNA" from other classes depending on what the inheritance hierarchy allows.
Unlike Java, besides single inheritance, Pega also supports pattern inheritance.
Pegasystems Inc.
IN
Hello Akash,
Thanks for posting your query.
Instance: In object-oriented software terminology, an instance is a single example of a concrete class. The New operation creates a new object instance of the class.
In most situations, PRPC uses the term New for the act of creating a new instance, rather than the Java term constructor or instantiation. Refer PDN help of a specific PRPC version. I have referred the Pega 7.1.8 help.
Hope this answers regarding your query on instance.
Regards,
Rincy
Cognizant
IN
thanks for your reply but i have a question is instance and object is same .
metasenseusa
US
Hi Akash,
No they are not same as per my knowledge but Moderators May correct it.
Achmea
NL
Hi Akash
An Object describes a thing. Like properties and doesn't exists. It's not in the memory of the computer. Its just a definition. When you create the object then its goes into the memory and it will exists. At that time you can access that object. An instance is the object in memory with the definition.
For example:
See it like a bleuprint of your house. The bleuprint describes that house, but you can not sleep in it.
When you build (create or instantiate) that house confom the blueprint, than you can sleep in it, or paint it
If your brother wants also a house, he uses your bleuprint to create its own.
I hope this makes it more clear to you.
Kind regards Bernard
Virtusa Consulting Services
IN
Well said. :) Bernard.
Cognizant
IN
Hi Bernard
Thanks for the reply . As you said object is a definition with no physical existence but as far as i know class provides the template and object is its physical implementation . If its correct than how object is different from instance. plz correct me if am wrong .
regards Akash
Bits In Glass
GB
Hi akash,
Both the Object and Instance are the one and the same.it is a naming convention.
in java we call instances.in pega you all these instances of a specific class to be Work objects.
"Class is the blueprint and the instance/Work object generated is the one which is stored in the DB."
Evonsys
IN
Hi Akash,
Object and Instance are different.
An instance is just a reference without any values for the properties.
But when u add the values for the properties of the instance it becomes an object.
Ex in JAVA,
Consider,
Class Name is Fruits with Variables Colour and Name,
Instance is
Fruits F1;
Object is
Fruits F1 = new Fruit ('Red','Apple')
Accepted Solution
Pegasystems Inc.
US
A class is the "DNA" used to instantiate and later update an object.
A class can inherit "DNA" from other classes depending on what the inheritance hierarchy allows.
Unlike Java, besides single inheritance, Pega also supports pattern inheritance.