Marcantonio,
 
maybe the Singleton Pattern could be used to grant only one instance for this shared repository.  But even in this case we need to implement the rules (in any Business Object) to check the repository first or to insert a new content in the repository.
 
Anything else?
 
Aldo Menezes d'Aquino Neto
L�der de Projetos - Navita
[EMAIL PROTECTED]
www.navita.com.br
Tel: +55 48 225.5396
Cel: +55 48 9911.5598
 
 
----- Original Message -----
Sent: Friday, January 07, 2005 4:11 PM
Subject: [CFCDev] Shared persistent objects pattern ?

Hello,
 
I have a problem and I don't know if there is a pattern for this, or even if this is considered a good design:
 
- Due to performance factors, I don't want to go to the database every time someone gets a content object, I rather prefere to "store" this object
in memory so I can reuse it whenever it's invoked from the view.
 
- In traditional (or procedural) development, I would store an array of structures (or queryes) into an application var, and every time someone want some content,
I would first try to get it from the application array, if it's not there, I would go the database, retrieve it and also insert it into the shared array.
 
- If someone "updates" one of the the records, I can update the table, and the application.array.structure content, so I would have both,
the persistent and the "etereal" records both updated.
This is all very straightforward to do in CF, I have done it before since CF 4.
 
I'm considering to use the gateway in Blackstone to send a message to the CFC that will update the database,
so I won't even have this database access action contributing for the overall system performance.
 
When transporting this concept to objectland, it seems obvious to me that a design pattern must be used,
both for the "shared object reposytory" and for the "message that will update the database" functions.
 
So comes the question: Is there any patterns out there for doing this ?
 
 
Regards,

Marcantonio Silva
Diretor de Desenvolvimento de Produtos - Navita
[EMAIL PROTECTED]
www.navita.com.br
Tel: +55 11 3055.2004
Cel: +55 11 7732.4907 (novo)


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.9 - Release Date: 6/1/2005
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.9 - Release Date: 6/1/2005

Reply via email to