revised SRB actors
Currently the SRB actors in kepler get their connection to the server from an actor called SRBConnect which passes the SRB connection as a token to any actors that need access to the server. This solution is good as it is intuative, however as more and more SRB actors are born the number of links carrying SRB connections to different places all over the workspace makes workflows look messy and hard to follow.
To fix this i've come up with a method of passing the SRB connection around to other actors without needing to link actors to a SRBConnect actor.
This is done by using a static class called SRBServerManger which stores connections to SRB servers and allows any actor that needs the SRB connection to query it and get the SRB connection.
One thing i had to keep in mind for this was the possibility of having multiple servers on a single workflow or multiple workflows that use the static class as the same time. I solved this by passing the workspace object and a SRB server id to SRBServerManger and have it store and retreive srb connections based on these values. The workspace object is availiable from any actor class. The server id is to be set by the user, and is only unique to each workflow (i.e. every seperate workflow can have a server id 0).
To avoid the added complexity of making the actors call SRBServerManger, i build a base class called SRBActor which any actors that require SRB access can extend. The SRBActor class adds a SRB server id parameter to the actor extending it, as well as a method for getting the SRBConnection, which handles all the talk with SRBServerManger.
Another actor was created called SRBServer, which has no input or output ports, but has Parameters for all the nessesary information to initiate an SRB connection and, during the pre-initialise stage of the workflow execution, sets up the connection to the SRB server through the SRBServerManger.
This method makes the workflows look a lot cleaner, and also makes creating new SRB actors very simple.
My only problem is that it removes the visible link between the SRBServer actor and the other SRB actors. However, if the SRBServer actor is thought of as a Director for other SRB actors than the need for a visible link is removed.
To fix this i've come up with a method of passing the SRB connection around to other actors without needing to link actors to a SRBConnect actor.
This is done by using a static class called SRBServerManger which stores connections to SRB servers and allows any actor that needs the SRB connection to query it and get the SRB connection.
One thing i had to keep in mind for this was the possibility of having multiple servers on a single workflow or multiple workflows that use the static class as the same time. I solved this by passing the workspace object and a SRB server id to SRBServerManger and have it store and retreive srb connections based on these values. The workspace object is availiable from any actor class. The server id is to be set by the user, and is only unique to each workflow (i.e. every seperate workflow can have a server id 0).
To avoid the added complexity of making the actors call SRBServerManger, i build a base class called SRBActor which any actors that require SRB access can extend. The SRBActor class adds a SRB server id parameter to the actor extending it, as well as a method for getting the SRBConnection, which handles all the talk with SRBServerManger.
Another actor was created called SRBServer, which has no input or output ports, but has Parameters for all the nessesary information to initiate an SRB connection and, during the pre-initialise stage of the workflow execution, sets up the connection to the SRB server through the SRBServerManger.
This method makes the workflows look a lot cleaner, and also makes creating new SRB actors very simple.
My only problem is that it removes the visible link between the SRBServer actor and the other SRB actors. However, if the SRBServer actor is thought of as a Director for other SRB actors than the need for a visible link is removed.
Posted by
TristanKing
on
2006-03-09 13:55
Trackback
The URI to TrackBack this entry is: #-
slots:
slots
<a href="http://www.online-casino-123.info/slots.html">slots</a> <a href="http://www.casino-information.biz/Free_Online_Black_Jack/Free_Black_Jack.html">black jack</a>
-
Cheapest car insurance:
Cheap car insurance
All information about cheap car insurance