Re: Design question: User objects and a Role object



On Oct 9, 9:31 pm, Anthony Smith <mrsmi...@xxxxxxxxxxx> wrote:
I have a user object that is set when a user logs in. There are also
permissions that I get about the user from a web service. Currently I
take the results from those web services and store them as XML in the
user object so I can parse it when I need to look at them. I wanted to
turn the xml permissions into ROle objects, but does that mean that my
User class needs to make reference to the Role class?

User class example

class User{

protected $firstName;
protected $lastName;
protected $employeeNumber;
protected $orgCode;
protected $roles; //Could this be an object of my class Role?
protected $scope;
protected $type;
protected $primaryAssignmentsXML = null;
protected $securityRolesXML = null;

.... getters ad setters

getRole(roleName){
//get the securityRolesXML and then parse it setting the Role
Object

$role = new Role();
$role->setName();
$role->setFunction();

return $role;
}

Is this how I should be going about this?

Theoretically looks ok. But, practically you'll end up deeper
object chains which might need caching to improve performance.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
.



Relevant Pages

  • RE: SP1 Problem SOAPException doesnt return quote and Umlaute correcty
    ... I suspect that there is an encoding issue in the way you are loading the ... Is there an inconsistency between the XML encoding mark up and the ... Found out .net web service clients are just as helpless with handling these ... If an exception is raised in the web service method saying i.e. 'The method ...
    (microsoft.public.dotnet.framework.webservices)
  • Consume Web Service...
    ... to call a web service in my orchestration. ... Xml parameters as string datatypes and processes this Xml and returns ... ignoreCommit, XMessage msg) ...
    (microsoft.public.biztalk.general)
  • Re: Question for all of you EXPERT.NET architects
    ... While you may receive a factory and build your own factory, ... as you can consume the serialized XML and change things ... How do you develop a web service that uses unknown types? ... > tier and a data tier that are loosely coupled. ...
    (microsoft.public.dotnet.framework.webservices)
  • Help please: Exception when with <input type="file"> but not with Textbox
    ... I have a web service that consumes an XML file as well as a few other ... This web service works fine if I use the web test interface. ... ' Notice that the comparison below shows the strings are *EXACTLY THE SAME* ... TestDWS_ASPX.PDF_WS.WatermarkID.TSILogo, enDealPart) ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: SP1 Problem SOAPException doesnt return quote and Umlaute correcty
    ... We are not creating any fault node data. ... In VS create a new web service project. ... where the code you are using to set up the XML is double converting. ... But then this is replaced by character references once again which results ...
    (microsoft.public.dotnet.framework.webservices)