design patterns in log4j

hi i have a question that was asked to mewhat pattern does log4j appender(consoleappender,rollingfileappender etc) implement?candidates can be dao, facade etc....can somebody xplain what pattern does it use and howtechy
[261 byte] By [techy2001a] at [2007-11-26 12:20:37]
# 1

you can swap different appenders in and out of log4j, that's the Strategy pattern

you make one logging call to log4j, and it notifies however many appenders there are congifured. the appenders are Observers

there are no doubt other patterns at work internally, but if this was an interview question, chances are they're looking for the above

georgemca at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...
# 2
is there a possibilty of proxy pattern involved somewhere?
techy2001a at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...
# 3
> is there a possibilty of proxy pattern involved> somewhere?what's the bigger picture? why such a leading question? why do you think there may be a proxy?
georgemca at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...
# 4
actually this question was given in an exam and the answer that the teacher gave was proxy pattern.i m not able to understand how it applies proxy pattern?thanks
techy2001a at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...
# 5
I suppose you could argue that the Logger class is proxying the appenders, but it's not the most obvious pattern presentin reality, you don't often find code that exactly fits exactly one design pattern
georgemca at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...
# 6

> actually this question was given in an exam and the

> answer that the teacher gave was proxy pattern.

Actually, if you think about it, only the individuals that programmed the log4j code know what design patterns they actually used.

As an outsider, just because an application "looks" like a pattern might have been used, does not mean it was actually used to design the application.

Futhermore, just because an application's functionality may fit in well with how one envisions the pattern's possible implementation, this too, does automatically equate or represent the fact that the pattern(s) were used.

This is a poor question to have on an exam, especailly if the individuals taking the exam were not the ones that worked on log4j. If the exam was given to log4j programmers, then it is a reasonable question.

To ask this question to assess knowledge/experience with log4j or object-oriented design patterns is a bad decision, in my opinion.

Only close and detailed inspection of the log4j source code will reveal what design patterns were actually used. Again, to question someone on this is inappropriate, unless it is for the log4j development team, in my opinion.

> i m not able to understand how it applies proxy

> pattern?

I understand your confusion.

GhostBustera at 2007-7-7 15:10:58 > top of Java-index,Archived Forums,Socket Programming...