N64vSNES, I have avoided reading the garbage you've posted in other topics, but now I cannot do so. =/
I am simply appalled by your response to a fellow developer asking a legitimate question (one that any beginner would have) with your haughty, highly opinionated and downright incorrect philosophies regarding both "Design Patterns" and concepts of "OO Design."
I don't tend to get mixed up in debates regarding "superior designs" as they are like arguing religion--your only basis is for what you believe will need to be added to you architecture in the future, and the empirical proof of past "Jesus's" (more experienced developers) claiming to have already found the light. However, you aren't arguing one design pattern over the other--you've picked one out that you've drawn favor to as it allows for incredibly simple architectures to quickly come to life with little overhead design, defend it as though it's your diety, yet are unable to display that you're competent enough to distinguish the subtle yet vital difference between "Design Patterns" and "Programming Paradigms."
I simply don't feel right allowing you to mislead the minds of readers. People like you are why the internet is plagued with a plethora of useless debates about "singletons" and their uses, yet don't seem to know where the design actually fits into software development methodologies. What I'm referring to is the repeated posts of yours I've seen like this:
However most Object Oriented obsessed programmers say this is bad design so you could instead use a similar method with a AssetManager
This blatantly ignorant statement shows immediately that you have had no formal (or informal) education in software engineering what-so-ever. You honestly should not be anywhere near new developers, as you need to sit down and get your definitions right.
One vital part to being a successful developer is communication. If you are unable to speak in programming terms, you really don't need to argue using them. This is especially applicable when your main defense for singletons is "other designs are
overly OO" as though a singleton is
not an
OBJECT ORIENTED DESIGN PATTERN.
So, lets zero in and see why this one sentence warrants this entire, long response. First of all, you don't seem to understand what a Design Pattern is at all. I'm not going to spend my time linking or detailing the true definition in regard to software development, (as I can be doing something useful instead
), but I'm sure if you're interested you can figure this out via google. What I will do, however, is point out the fact that "Object Oriented Design" is a design
paradigm, not pattern, and a Singleton is a
very specific Object Oriented design
pattern requiring encapsulation and abstraction barriers. Your statement implies that Gyro's solution was somehow "more or less" object oriented than yours simply because they are more in-depth designs. This is absolutely absurd! There are plenty of
procedural design patterns out there, yet you seem to have the misunderstanding that a Singleton is among them? ;p
KeithStoffel's question was a very broad and high level one regarding problems with accesss levels. This is nothing architectural and, quite frankly, shouldn't be answered with a design pattern. Instead, somebody may want to go about introducing him to some
common design principals of access such as how to build a system with a higher level object containing/accessing lower, how to pass objects value/reference, how to aggregate, use composition, etcetcetc.
Instead, you've responded with a Design Pattern created to cater to a very specific situation in which it must be ensured that no more than one object
can exist at all.
Why in the name of FLYING SPEGHETTI MONSTER would you do this? This is the metaphorical equivalent of being asked "How do I get from point A to Point B" and responding, "Well, you can either Jet Skii, which is done like this <insert example> or you can act like all the other fucking retards who prefer waterside forms of transportation in order to move <insert thread to larger discussion.>"
See what I did there?
Now the only question is...Why would you do this? Are you intentionally trying to confuse him? Of course not. You simply
don't have a full understanding of the topic athand. The only reason you've suggested a "singleton" to him is because of global access. The only requirement in his question was "how do a bunch of things touch another thing." Nothing in there implies needing "one instance," dude. ;p
So, you literally just answered him by demonstrating that you don't understand what OO design is, don't know how to provide object access without globally scoping a reference, and don't know wen to use a singleton, how to implement it, and what
exactly you think of all the biggots who actually
do know what they're talking about.
Congratulations, I hope you're well!
EDIT: Edited for change in vibe + to be less douchebagish. ;p