Singletons in agent++

Frank Fock Frank.Fock____t-online.de
Wed Jun 5 20:31:49 CEST 2002


Philippe,

May be I was too quick in answering:

Philippe Roger wrote:

> Given that you spent some time abstracting the log concept
> into an AgentLog abstract class and then provided a real
> implementation with AgentLogImpl, I would argue that if
> someone needs a different log implementation, they SHOULD
> provide a different implementation of AgentLogImpl. Isn't
> it what it's for?  I'd say: problem solved.

Doubted my own code ;-)

>
> On the second and more important point, I see where you are
> coming from: "helping" the user code, without creating too
> many constraints.  However, I would rather have an extra test
> for a NULL pointer rather than an unsightly crash.  It's not
> like this code is _really_ optimized for speed, with the

Optimization is always a compromise...

>
> numerous conversions to and from strings, and all the temporary
> objects.  What I am saying here is that agent++/agentX++ may
> not be suitable for very small/slow embedded systems anyhow,
> starting with the C++ requirements, of course, including
> templates. The users of agent++/agentX++ are very likely
> running on a "decent" size machine (in RAM and CPU power).

There seem to be many AGENT++ users with embedded
systems. So my aim is to reduce extra costs as much as possible,
but nobody is perfect. Another problem is, that theoretically a
function call is more expensive than accessing a member, but
with compiler optimization the difference could be very small.

Shortly said, I will consider your suggestion for the next dot release
of AGENT++.

Best regards,
Frank





More information about the AGENTPP mailing list