Thursday, 15 August 2013

vb.net - Best practice for accessing global Silverlight application data -


Text after "

I found Silverlight 5 a website that has got a group of applications hosted in some application-specific data sets. One of these figures is the current user object.

When the app starts (each one), it talks to the web service to pull current user information. However, in this SL application need to be accessed by all types of places.

I thought it made sense to put the built-in application on the object, but I was not sure if it was a good practice.

I put a simple property that puts the user in an interface and has applied it to the main app class.

Then, the rest of the application code accessed by it through a stable class:

  Public Module ApplicationUtils Public Property CurrentUser () as ConnectEntities.WebUser Receive ICommonAppData = Retrieve App TryCast (Application.Current, ICommonAppData) if the application isnot nothing (after nothing) then the return app.CurrentUser end then return nothing set (as the value ConnectEntities.WebUser) ICommonAppData = TryCast (Application.Current, ICommonAppData) are slow applications (application isnot If there is nothing, then the app.CurrentUser = value ends then the new NotImplementedException ("the current application does not apply the required interface") End the end end of the end end of the end terminal module  

I am not very familiar with, so I am trying to figure out whether it is an acceptable practice to reach global data, or if there is any complexity which I am not feeling here (thread safety issues, etc.) .).

After the text "itemprop =" text ">

I think it was also unable to find anywhere mentioning any details of using the application Need high privileges for Current property Also, in all my tests, it seems that I am able to use this property without the prerogative (with both local tests as well as the app posted on other machines).

I have moved forward with my original design and everything works fine.

Whether this is a best practice or not, I do not know. However, it is a reasonable solution to access such data.


No comments:

Post a Comment