DIY-DI

Published by:

The “dependency injection” (DI) technique is a way to improve testability and maintainability of object-oriented code. Typically adoption of dependency injection is coupled with adoption of a dependency injection framework, such as Guice or Spring. These materials show how dependency injection can be accomplished without any framework. The same benefits provided by frameworks can be realized using “do-it-yourself” (DIY) handcrafted code. This model is named DIY-DI, pronounced die-die.

Update (May 29, 2010): I added a comparison with Guice and more polished code snippets to the DIY-DI manual.

Judge Not

Published by:

How does a person know which church is true? More generally, how does one know whether anything is true? An investigation into this question helps reveal an answer to the abstract question, “What is truth?”

This essay presupposes that there is a God and a divine truth. Call the following Proposition I:

I. It is possible to learn about God.

Proposition I will be treated as an axiom. If the proposition is false, then there is no reason to continue the discussion further on this or any religious subject. So let it be accepted on faith.

Religious leaders teach ways to discern whether something is true, by listening to God. Call the following Proposition II:

II. Divine inspiration is a reliable way to know what is true.

If inspiration from God does not lead us to truth, then what could? One alternative is to listen to prophets or other special individuals that give us God’s words. But since there are so many different sources that claim to know God’s will, a person still has to choose between them. That decision itself requires that a person be privy to personal inspiration. Another alternative is the belief that it is impossible to know what is true. But that contradicts Proposition I, because it leaves people without a way to learn about God. Once it is accepted that Proposition I is true, then Proposition II must follow.

Next, conduct a thought experiment involving two sincere people. Both practice different religions. Is it possible that both of them feel that they are following God? Simply out of respect for various religions and for their faithful members, it is easy to conclude the following:

III. Sincere people following their beliefs can be found in many different religions.

It seems reasonable to claim that not all religions agree on what is true. Even though it could be argued that all religions are on the same path, that is certainly not an argument that is supported by many of the religious adherents themselves. So then what would happen if the people in this thought experiment are both in the habit of praying about their beliefs? Specifically, what is to be expected if both of them pray about whether their respective religions are true? One easy answer is that neither of them would ever get a response from God. But that would contradict Proposition I again. Another theory is that one of them (or possibly both of them) would receive an answer that their current religion is wrong. That experience certainly has happened to some people. However, it’s not possible for that to always be the case for all people. If it were, then all the sincere people would leave those wrong religions. Eventually all sincere people would belong to the same religion, and the other churches would be left with the people who either didn’t pray about their religion or who didn’t heed the answer. That theory contradicts Proposition III, which asserts that no single religion has a monopoly of sincere believers. The only reasonable explanation is that people of many churches have prayed about their respective religions and have gotten an answer that theirs is true.

IV. An answer to a prayer for one person can contradict an answer to a prayer for another person.

The next task is to discover what it means for different answers to be given to different people. The most common reaction to this paradox is to adopt the philosophy of cold absolutism. Namely, only one of those answers can be true. At least one of the people who thinks they know the truth is actually confused or deceived. This is an attractive philosophy because it means that the truth is simple, and that some people are right and others are just wrong. It’s an especially attractive philosophy if you believe you are one of the people who are right.

Unfortunately, absolutism cuts like a double-edged sword. It admits the existence of confusion in personal revelation. If it is possible for someone to think they have received inspiration from God but in fact they have been given a wrong answer, then how can any person avoid being deceived? Anyone who thinks that prayers are less than perfect for other people should put himself or herself in those shoes. This explanation is tantamount to saying that many answers to prayers are not accurate, which contradicts Proposition II.

A similar absolutist explanation is that both answers may contain some truth, but both are not true to the same degree. In other words, an answer from God may lead someone towards truth without revealing the whole truth. Because of that, a yes–no question about whether a principle is true might evoke either a “yes” or a “no” answer depending on the maturity of the listener. Again, this belief is more attractive to people who think they have received a greater degree of truth than their neighbor.

This theory would mean that people who are following answers to prayers can trust that they are on the right path, but they cannot know whether the answers themselves will prove true in the end. They can assert, “I am following the path that is right for me.” They are not justified in saying, “My doctrine is correct.” According to this theory, prayer is not expected to reveal correct principles. At most it reveals a correct direction. Unfortunately, this undercuts Proposition II.

Many faithful believers are wont to say, “I know my church is true.” If absolutism is correct, then testimony like that is merely speculation. Even when someone claims to be a prophet or missionary and to teach God’s word, they could still be incorrect. Worse, a proselytizer makes the additional mistake of succumbing to overconfidence in such convictions.

It’s common to find people in pursuit of “universal truth,” which is an absolutist concept. Universal truth means truth that is the same for all people all the time. Based on the foregoing discussion, universal truth could be seen as a temptation created by the devil, rather than the handiwork of God. If universal truth existed, then it would be austere and unattainable.

While it would be hard to disprove this theory, it is certainly unpalatable. It would be comforting to discover an alternative theory, in which prophets are not presumptuous, and in which divine truth is accessible. The following proposition springs from this wish:

V. It is possible to know true doctrine, and to know that one knows it.

If Proposition V is true, then what are the consequences? It contradicts absolutism, because in absolutism there is no way to distinguish between the person who is incorrect and the person who knows the truth. This proposition implies that different people could seek God, (as in Proposition I), they could feel inspired that their religion is true, (as in Proposition II), and those people could all belong to different religions, (because of Proposition III), and they could hold irreconcilable beliefs, (as in Proposition IV), yet their beliefs must all be correct, (because of Proposition V).

The assertion that, “My church is true,” is similar to the affirmation, “I am special.” From an absolutist perspective, neither statement has any meaning when everybody is saying it. Paradoxically, though, we don’t look down on people who say they are special. We don’t view all the “special” people as being in competition with each other, and that’s because they don’t intend for their specialness to be exclusive. We never worry that only one person is special and that all the other people are wrong. Likewise, the commitment to a religion makes sense when it is viewed noncompetitively. If two sincere people claim to belong to the only true religion, then let’s be generous and grant that they are both truthful. We may need to reexamine what “truth” means.

VI. All the different voices that proclaim their religions are true can all be simultaneously correct.

The most natural reaction to Proposition VI is to assume that all religions are equal and even interchangeable. In the previous thought experiment, two people from different religions each felt the inspiration that their beliefs were true. If the first person left his church and joined that of the second person, then he would be denying his personal revelation.├é┬áIgnoring inspiration always runs contrary to Proposition II, because there is no better source for divine truth. Certainly to that person, the two churches are not interchangeable. Meanwhile, if the second person does not follow his personal revelation by remaining dedicated to the second church, then he is likewise leaving God’s path. Each person is responsible for following all the inspiration they have received. The fact that a certain revelation was given to the first person apparently should not be used by the second person as justification to follow the same.

A consequence of Proposition II is that the truth is defined externally, by God. That can hold even though the truth may not be the same for each person. In other words, Proposition VI does not state that people can whimsically choose whatever religion they want, (although that is a popular relativist philosophy). Each person gets to discover truth independently, but each person does not get to invent the truth as they wish it would be.

What then does “truth” mean, if reality is so plastic? In absolutism, truth is whatever agrees with physical reality, which is the same for everyone. In this alternative formulation, truth is whatever agrees with personal divine inspiration. The latter idea is easier to understand in some ways, even though it may sound foreign. For example, philosophers get into arguments over the fact that reality gets interpreted by different people in different ways. Reality presents a new face depending on the observer. That debate could be extended into spiritual realms, where uncertainty and disagreement are common. Only through divine inspiration can one get a clear picture of what God wants us to see. From there, it only takes a small logical leap to define the divine inspiration itself as the real truth. In other words, nothing is more true than revelation from God, even though the revelation is confined to the receiver’s own mind. The idea that something external must be more true than our thoughts is an absolutist illusion.

Suppose I am reading a book of scripture. Even though it is easy to believe that the book itself physically exists outside of my mind, I don’t have to believe that my testimony of the truth of the scriptures is likewise physical or outside myself. I wouldn’t be surprised when others who handle the physical book still disagree with my beliefs about the book. Spiritual truths are simply not required to follow the same laws that common sense expects of physical things. I could conceive of a world where God wishes to impart different truths to each individual, so that they share physical reality but not spiritual realities. God, knowing all, may see the threads by which each of those truths can lead directly to him, even when mortals are unable to understand how their various beliefs refer to the same God.

Under this definition of reality, it does not make sense for two people to expect that they both have the same understanding of truth. It is as if our existence is an individual gift, and what we know as our spiritual reality is tailored for us alone. It is pure vanity to try to judge someone else’s beliefs according to our standards. We are only able to decide that others’ beliefs don’t agree with our standards, or that others’ actions don’t agree with the government’s laws. We cannot make the additional presumption that those others have disobeyed what God instructed them. So what should be done to reconcile our beliefs with the people around us? The Bible commands us to “judge not.” It is sufficient in this life that we each understand and follow the truth that has been given to us. To try to appraise the world’s spirituality according to any one standard is to want something that we were not meant to have.

A reasonable concern that is raised by this argument is whether or not people should attempt to share their beliefs, knowing that their listeners inhabit different spheres of spiritual reality. One promise that should make a difference is found back in Propositions I and II. Whenever two people discuss their beliefs and feel the presence of the divine, then they are learning about God and can trust in the information. Scriptures record that God at times calls people to teach to each other, and that those words can frequently help others on their own path. Those people who endeavor to preach the truth may not be guaranteed success, but these propositions will give them no excuse to abandon their efforts.

Seeking out truth is still important to people who oppose absolutism. The opinion that universal truth must be the only kind of truth is a misconception. Renouncing absolutism can even lead to a healthier respect for other beliefs. The key to finding an alternative is understanding that spiritual truth is a private matter between each individual and God.