on 08-07-2006 8:35 AM
Hello All,
Am new to Web Dynpro and reading about the Singleton property of Contexts.
Am referring to link: http://help.sap.com/saphelp_nw2004s/helpdata/en/81/95384162316532e10000000a1550b0/frameset.htm
but did not get the concept.
Would appreciate if you plz help me understand the same.
Awaiting Reply.
Thanks and Warm Regards,
Ritu
Message was edited by: Ritu Hunjan
Hi,
This is a bloga nd it is pretty much in detail about singlton and
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/cardinality%2bproperty%2csingleton%2bprope... this link is blog related to pin in using singlton:https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4810. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gareth
If you see the properties of root context node, always
cardinality : 1..1
singleton : true
because only one instance of root context exists.
if you create a node under root context node that can have signleton : true or false
if true you can not create more than one instance and bind it to the root context.
else if false you can create multiple instances of the node and bind it to the root context.
hope it clears..the confusion.
Regards
Abhimanyu L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You might also want to search on Google for singleton explanations - the singleton principal is one that applies to most object orientated languages (Java and ABAP just being some examples) so you may find a simple example of what a singleton is elsewhere that you can then relate to Web Dynpro contexts.
Hope this helps,
Gareth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gareth
If you see the properties of root context node, always
cardinality : 1..1
singleton : true
because only one instance of root context exists.
if you create a node under root context node that can have signleton : true or false
if true you can create more than one instance and bind it to the root context.
else if false you can create multiple instances of the node and bind it to the root context.
hope it clears..the confusion.
Regards
Abhimanyu L
Hi Ritu,
If you have node hierarchy in the context like, You have Node1 and inside Node1 you have childNode1.
Both nodes have 0..N or 1..N cardinality.
Now, ChildNode1 elements are depends on the parent node elements.
There are two possibilities:
1. All the childNode1 elements are common for all the Node1 elements. Each Node1 elements have common bunch of elements from ChildNode1.
2. All Node1 elements have their own bunch of the ChildNode1 elements.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "singleton" property defines if a context node instance exists per
- parent element (non-singleton)
- parent node (singleton)
Chris Whealy's book "Inside Web Dynpro for Java" explains the concept rather good.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritu,
The Singleton is a useful Design Pattern for allowing only one instance of your class.
The Singleton's purpose is to control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes. Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just like static fields.
Singletons often control access to resources such as database connections or sockets.
Ex :- If you want to access your Database with one connection, then make the connection class implements Singleton Interface.
public class DataBaseConn implements Singleton{
}
In WebDynpro
Singleton decides whether a single instance exists at a time for a node. If you declare a node as singleton, how much ever elements you create for the node, it will access the same element.
Regards,
Sridhar
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.