confusion over parsing data through layers
-
Hi, Can someone explain the following to me. If I set a value in my Business layer, I am able to access it from another page?
'Code behind page 'Import the BLL layer Import MyApp.MyBLL 'Method to Set the value MyBLL.SetPermission(1) 'Method to Retrieve the value Dim intPermissionLevel = MyBLL.GetPermission() 'Business layer 'The value to be kept Public Shared intPermissionLevel As Integer 'Go find the user Level Public Shared Function GetPermission() As Integer 'Go find the user Level Return intPermissionLevel End Function 'Go Set the user Level Public Shared Function SetPermission(ByVal intSetPermissionLevel As Integer) As Integer 'Go Set the user Level intPermissionLevel = intSetPermissionLevel End Function
I am able to get the value set in "intPermissionLevel", from another page. I set it in say page1.aspx, and then I can get the value again, from page2.aspx Is this because the value is shared - and is this a good method? I do not quite understand this.... -
Hi, Can someone explain the following to me. If I set a value in my Business layer, I am able to access it from another page?
'Code behind page 'Import the BLL layer Import MyApp.MyBLL 'Method to Set the value MyBLL.SetPermission(1) 'Method to Retrieve the value Dim intPermissionLevel = MyBLL.GetPermission() 'Business layer 'The value to be kept Public Shared intPermissionLevel As Integer 'Go find the user Level Public Shared Function GetPermission() As Integer 'Go find the user Level Return intPermissionLevel End Function 'Go Set the user Level Public Shared Function SetPermission(ByVal intSetPermissionLevel As Integer) As Integer 'Go Set the user Level intPermissionLevel = intSetPermissionLevel End Function
I am able to get the value set in "intPermissionLevel", from another page. I set it in say page1.aspx, and then I can get the value again, from page2.aspx Is this because the value is shared - and is this a good method? I do not quite understand this....>>Is this because the value is shared Ya. >>is this a good method? It depend on your system and what you wanna do with this member. If you set the method/property as shared then you don't need to create an instance of object in every pages. so, it has less memory allocation. but you hav to take care of concurrency issue. (what if multiple users are accessing your page at the same time.)
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message. Thank you.