Posted By: jogisarge | Jan 26th @ 12:57 AM
page 1 of 1
Comments: 3 | Views: 732
Hi,

i have an application with my own Login-System.
when a user starts the app and logs correct in,i want to store user-data in a class "Userinformation".
other information like application-rights and so on should be also stored in this class.
my application is coded in 3-tier architecture with one assembly each tier.
i have to access the Userinformation class in many other forms - also in the business tier.

How could this be done ?
I know that global Vars are not allowed in C#, but how can i get this problem done ?

i had the idea to create a dataset, that has tables for this information ?


bye jogi
harlock123
harlock123
Tall, Dark, and Gruesome
A Static class defined in the Program class would be available to all the tiers from the Program.{Whatever} designation.....


Yggdrasil
Yggdrasil
Pour me a cab, 'cause I can't drink no more.
What? No! Don't do that.
Never rely on a globally-accessible static member. It'll come back to bite you when you want to span your 3 tiers on different systems. Statics are hard to mock when testing and hard to scale out when expanding.

A dataset - or a custom non-static object - would be a much better choice to hold configuration data. Especially when it contains per-user data. 
harlock123
harlock123
Tall, Dark, and Gruesome

Ok
Enlighten me then as I obviously am thinking incorrectly...

This custon object or the data set

where would it be defined and persisted in the applications lifetime....

 

page 1 of 1
Comments: 3 | Views: 732
Microsoft Communities