[opencms-dev] Question about creation/reuse of template classes
Thomas März
thomasmaerz at gmx.de
Mon Jun 16 13:46:00 CEST 2003
"Michael Schmitt" <mi.schmitt at gmx.de> writes:
> It would be nice if someone will, at least, tell my why my posts are
> unaswered?
Maybe noone had an answer. I don't know.
> I wrote several template classes.
> Some of them will be cached dependent on some parameters.
> Others should never be cached.
> The caching mechanism works as I expected (several variants
> have been created dependent on different parameters).
> But for the templates that should not be cached, I am uncertain
> about the creation of new instances of my template class. It
> seems to me as if a new instance is created for every call (every
> web-call of a page that uses the corresponding template).
Why does it seem so? I think if caching is disabled the template is
being parsed for every request; so if you are creating Objects in your
Class there will be new ones for every request.
> But I would like to have that for every call the same instance will
> be reused.
> Is this somehow (cofiguration, programming) possible?
http://www.fluffycat.com/java/JavaNotes-GoFSingleton.html
> A second question (that is only relevant if no new instance will
> be created for every call) is about thread-safety of the template
> classes.
> Does OpenCms ensures that only one thread accesses the
> getContent() method of the template classes?
I think there's no thread around there.
I don't know if this did help you, so maybe you understand why you
didn't get many answers. Or it was just me who can't give an exact
answer. Anyway.
Best Regards,
Thomas März
More information about the opencms-dev
mailing list