[Backalaika-developers] Singletons and a few design ideas
Status: Beta
Brought to you by:
nandof
From: Nando F. <nan...@ma...> - 2004-09-28 12:19:32
|
Fabio Piemontesi wrote: > Nando, I don't agree with the phrase, "SingleCall is stateful". I meant "SingleCall is stateless", but it was 2:00 in the morning. Having slept over my question, "why use the singleton pattern", I have come up with at least one good reason: I complained in a previous message that the server-host only *contains* the remoted class, without any knowledge about it, since it is the client that creates an instance. But the singleton pattern contains a static variable which holds a reference to the single created instance, if any! This has the potential of solving that problem. If the server-host could get that reference and use it... I am going to try this today starting with the TempRemotingTest demo. *A few design ideas* *==================* Only after backup is working (very soon now): Keeping in mind that FileServers are accessed through "tcp://Computer:Port/uri": - ProfileSingle shall include new properties "Computer" and "Port". - "Computer" should be validated so it can't begin with "http:" or "tcp:". It also cannot contain "/" or ":". In fact, there's a lot of characters it shouldn't contain :) - If more than one profile references the same "Computer" but with different ports, Admin user should be notified of a possible problem. - BackupServer scans ProfilesList and realizes the time has come to make one scheduled backup. The info it needs to access the correct FileServer is right there in the profile. - When Admin is creating the list of folders to be backed up, it can ask FileServer directly -- no need to go through BackupServer for this. So Admin is now a client for FileServer, only for the purpose of obtaining all of its folders. Comments? Nando |