Encapsulation is a programming concept that refers to the ability to hide information about how a section of code works, instead requiring the person using the code to only have to know what information to provide and what results to expect. “Implementation details can be hidden within the objects themselves. This information hiding, as we’ll see, is crucial to good software engineering” (Deitel & Deitel, 2018, p. 12).
A great example of encapsulation in the Bible is Salvation. As Christians we only have to know what Jesus did: that He died on the cross for our sins, and rose to life defeating sin and death (1 Cor 15:3-4). If we believe that and put our trust in Jesus for salvation, He will save us. How does this work? We don’t understand the entirety of it. We understand some things, that death came for everyone through Adam’s sin and yet is offset as resurrection comes to everyone through Jesus’s righteous death (1 Cor 15:21-22).
The core of what we have to know is just what we have to provide and what results to expect: We have to believe in God and that Jesus, His son, came and died for our sins to restore our relationship with God. We know that happens because God has provided the explanation (or in programming terms, interface) for us through the Bible. However, the exact details of how Jesus’ death on the cross for us reverses the sins of each of us is never truly understood and explained. The Bible uses metaphors to explain to us what is happening (that we are justified, that we are adopted) but it never explains how it happens. This is the essence of encapsulation when it comes to programming.
A second form of encapsulation in the Bible is the battle at Jericho. In Joshua 6, God tells Joshua to have the Israelites circle Jericho one time a day for six days and on the seventh day to circle it seven times and to shout and blow the trumpets (Josh 1-5). This is the input: circling Jericho and blowing trumpets. The output: The city of Jericho’s walls will collapse and the Israelites will be able to take the entire city.
God doesn’t explain how the city’s walls will collapse or what circling the city has to do with it. That is all God’s business. All that the Israelites have to worry about is doing what God said, and watching as they get the results that God promised. In this sense, Jericho is a perfect example of God using encapsulation.