I've been working through the first 6 books in the Dune series over the past month, and I've reached a conclusion regarding books and our ability to tell stories.
First off, I absolutely loved the first novel. It had everything I was looking for in a sci-fi epic, and promised an interesting series. The second book (Dune Messiah) was less intriguing, though some of the internal politics and psychological analysis was interesting. Children of Dune was better than the previous: it had a destination (Leto IIs assimilation with the sandtrout to force humanity along the "Golden Path") and felt less rambling than the previous.
Then I hit God Emperor of Dune, and it spiraled downhill quite quickly. Leto's metamorphosis had been underway for 3,000 years, and the planet Dune's development had completed to the point where the Fremen lifestyle was a thing of memory. This book was difficult, to say the least, to drudge through, but it had a destination (Leto's death) which helped.
Enter Heretics of Dune. This book is, in every way, utterly uninteresting and unconvincing, to say the least. The only original character (after 4,000 years have passed since the first novel) only took center stage in Dune Messiah, something which made little sense, given his minimal presence and characterization in Dune. In Heretics, however, Duncan is the only unifying link with the previous 4 books. The Bene Gesserit, Tleilax, and Guild are still scheming and planning, and the planet of Dune is reverting back to its original state.
So, if Dune was so great, what went wrong??
To put it simply, time.
Think back, for a moment, 1,000 years. Our civilization was a drastically different place. For a simple reference, Wikipedia has an interesting article regarding the Eleventh Century and major events which occurred between 1001 and 1100. Though these events may have had an important influence on mankind, think for a minute what the world looked like at the time, and how the passage of a mere 1000 years has seen such drastic change. In addition to this, consider how different the world appears after the intersection and engagement of various cultures: within this time (from a Western-perspective) we've seen the advent of gunpowder, the Industrial Revolution, the Renaissance and Age of Reason, the Protestant Reformation, the advent of the automobile and flight, and have moved into the Age of Information. We live in an era where everyday realities would have been considered somewhat miraculous one millennium ago.
And yet, the evidence of human progress is completely ignored in the latter Dune novels. God Emperor begins 3,000 years after Leto II's ascension as deity, and no progress among humanity can be seen. The predominant argument for this is Leto's suppression of space-travel while imposing his "peace" upon the empire. Unfortunately, this is unconvincing and fails to account for the complete and utter stagnation of Herbert's universe.
In 3,000 years, no civilization makes any technological, cultural, political, or religious advances. The Bene Gesserit's plots and goals remain the same throughout the centuries, without any consideration to the historical progression of human thought. Herbert's position regarding religion seems reservedly cynical, yet withholds itself from any evolution of philosophy or vision. In 3,000 years, the Dune universe is no different than when Leto first began his metamorphosis.
Still, the argument remains that Leto's goal for humanity was to suppress advancement and evolution until the Golden Path was attained.
I'll accept the argument, though I disagree that it's sufficient to account for the stagnation.
Zoom forward another 1,000 years to Heretics and you still have the same problem. What's more, the problem is more greatly exacerbated: Leto's intention was to compress humanity to a critical mass, unleashing their full potential upon the vast reaches of the universe after his death. His dream, apparently, was to hold humanity back from its self-destructive tendencies, and then allow it to rapidly accelerate. Unfortunately, this acceleration is almost non-existent in Heretics.
Once again, technology hasn't advanced sufficiently to account for 1,000 years of unfettered progress. The same assassination techniques/tools are in use (shigawire, seekers), the same limitations exist (lasguns interacting with shields), the same drugs are still present (melange/spice). The introduction of "no-ships" are weak and portray a sad, unexciting existence for mankind.
Again, we are given a glimpse into the Bene Gesserit, and are informed of development and progression over several millenia. But where this progression is, the book doesn't say. Their breeding goals, fears, and biases are still strong and unchanged 4,000 years after Dune. Frankly, I can't imagine any organization or religion (from Herbert's perspective) surviving 400 centuries, let alone maintaining their original goals and world views.
Again, the final product is unconvincing and comes across as ignorant: such great leaps ahead in time remain unaccounted for in terms of culture, politics, religion, and technology.
I've observed this lack in other stories as well: the Foundation series, the Star Wars universe, to name a few. This leads me to wonder why they seem to fail in their scope.
As finite beings with a limited scope of change, I wonder if we're even capable of imagining a universe where massive leaps forward in time occur. Looking back, we can see the various connections in progress which have led us to the present. Hindsight, as they say, is always 20/20. Put another way, we have the ability to understand the mosaic of our development by analyzing each tile contributing to its creation. Unfortunately, we're less capable of understanding those pieces which will be used to expand upon its image. Because of this, how can we even attempt to imagine (other than idle speculation) what the product will look like after 1000 years of unknown tiles have been laid?
Think back to the futuristic images of the mid-20th century. Radio programs, movies, and sci-fi novels portrayed the 21st century as something much different than what we see. Looking back, we can see how the progression functioned; looking forward, however, we had no idea of the limitations and possibilities available to us.
Cars do not fly; we don't wear silver-foil suits; we are not living on the moon. We do, however, have vast amounts of information available to us, at the mere swipe of a finger or touch of a button. We still drive cars and fly in planes; Mars remains physically untouched by humankind; most people own a computer (yes, phones count); holographic TVs do not exist, though 3D technology is growing in popularity.
These are just a few technological progressions in 5 short decades; I've said nothing about the political, cultural, and religious changes which have happened in such a limited amount of time.
Of course, I don't want to misrepresent history: mankind's progress has frequently seen extended periods of stagnation with little development; fortunately, however, such periods have been fostered in specific environments. Once these environments were altered, or their limitations removed, explosions of development have been observed.
Herbert's series struggles to keep this in mind. In 4,000 years, little progress happens, a phenomenon disproved by human history.
Thoughts on theology, books, life, the universe, and everything.
Monday, January 18, 2010
Saturday, August 15, 2009
Truth in Worship?
A friend of mine recalled a song which was often sung in a church I previously attended. I hadn't visited in several years, and I completely forgot about this song. It was titled "More than Anything." Since I don't want to deal with the issues of copyright and citing sources, I'll leave it to the reader to look up this song on their own. I will, however, summarize the underlying theological point being made in the first line of the chorus (and resounding throughout the song): "God loves people more than anything."
Another song I remember from these days (again, please look up the lyrics if you're interested) came to our college group from a source I don't remember (I believe it's a Vineyard song, though I'm not positive). It was called "Every Move I Make." In summary, the underlying theological statement was (in accordance to the first line of the song), "Every move I make I make in You, You make me move Jesus."
Two interesting points are being made, during a church service, sung by a congregation to God Who sits upon His throne.
Before I proceed to examine these two songs and their theological ramifications, let me first state this unequivocally: I don't believe there was any intention upon the authors of these songs to cross theological or doctrinal boundaries. Most artists speak from the heart and the seat of their emotions (something which will be addressed later), and their motives often stem from sincerity and openness.
This said, there are two fundamental problems with these two songs, which can be traced (somewhat haphazardly, I'll admit) to a single issue.
First, let's consider these words: "God loves people more than anything." We know one of the perfections of God is His love. I John 4:7-8 states explicitly,
The nearsighted, and incomplete human experience we know as "love" finds its perfection in God and God alone. Within Him alone does love manifest itself to its fullest extent for because it is an attribute (for lack of a better word) He permits us to experience and apprehend. We do well to consider the love from the Lord and the means in which He reveals this to us.
But the primary theological point of the song isn't the reality of this attribute of God. It pertains to the direction of this particular attribute flowing in its fullest measure from top-down. God's love, according to the song, is expressed only in its perfection after mankind's creation and fall. In essence, God loves people more than anything.
Is this, strictly speaking, true? Does God love mankind more than anything? Does He love us more than Himself? Is there a lack in the unity and perfection of our Triune God in which He must seek the final expression of His love in something other than Himself? I would posit this to be absolutely impossible, bordering on the absurd. To say God loves mankind (fallen or otherwise) either places upon the Lord imperfection or mutability, both of which are Scripturally untenable.
What was God's state prior to the creation of mankind? Such a question is, of course, impossible for us to answer. Before our appearance, we have no knowledge of God's work or expression of Himself. In Scripture we are given glimpses of Him in His eternal Being; we read of occurrences (e.g. Satan's rebellion) in a spiritual reality of which we are not capable of interacting; we are even given insight into certain attributes of God which provide us with imperfect understanding of Who He Is. But, we are not given any glimpse into eternity-past.
Unfortunately, if we are to posit God's love for mankind exceeds His love for anything else, we must first attempt to grasp this as it relates from God as an eternal Being. Does God love us more than Himself? If so, what was the state in the Trinity prior to His creation of mankind? Was there an impenetrable barrier in which God could not express His love in its fullest to Himself? We know the Father loves the Son (John 5:20); was this love incomplete in eternity-past? Did the love of God (a fundamental attribute of His Being, according to the apostle John) grow in greater measure upon this one creative act? If so, this redefines God into a God of development and evolution.
Rather than God being complete within and of Himself, we are forced to accept a God Who, upon the creation and fall of mankind, experienced an altering in the fullness of one of His attributes, the result of which was the fullest expression of love being bestowed from the Creator to the Creator.
If we reject the previous assertion (as we should), the next question arises: What was the cause of such change upon the advent of fallen human beings? Did the Lord redirect the expression of His love in its fullest away from Himself (within the Trinity) to His creation? Is there any Scriptural precedence for such a position? According to Scripture, there is not. God has repeatedly revealed Himself to His creation as unchanging and immutable (Malachi 3:6). Unfortunately, this truth as ascribed by Scripture is incompatible with the statement, "God loves people more than anything." If the fullness of God was complete in eternity-past, and God reveals Himself as unchanging, then we can, logically, rely on His completeness after the creation of mankind. To do otherwise results in the same error as previous: God becomes a being of evolution and progress, rather than perfection and completeness.
So what's wrong with this statement: "every move I make I make in You, You make me move Jesus"?
The answer is simple: Jesus is not the author of sin, and, therefore, is not present in every act we make. He does not make us move in certain contexts and sinful expressions of our fallen nature.
Scripture is quite clear about the dangers of either ascribing sin to the Lord, or finding means to justify sin with theology (Romans 3:8). According to Romans 5, sin entered into this world through one man, not through an act of the Lord. Justification and redemption from the curse and enslavement of sin has been given through the direct intervention of God, and by these means we are set free. This, however, does not preclude the continued existence of sin.
In lecturing on Romans, Martin Luther coined a phrase which resounded throughout the Reformation: simul justus et peccator. This statement referred to the regenerated nature of sinful man: "simultaneous justified and sinful." Paul's statements in Romans 7 attest to this reality: though fully justified in the righteousness, and death and resurrection of Christ, he still experienced the daily struggle with sin and a nature which is bent away from the Holiness of God.
What does this song commonly used in church services and college groups say about this? It states, without equivocation, every move we make is in Jesus. Quite strictly speaking, this is a preposterous statement. Was Paul's lament regarding his inability to do right a condemnation of Christ moving him to do wrong? Of course not. Indeed, in verse 25 he breaks out into praise of the One in Whom righteousness and justification is found.
The words of this song beg a question: are we moving in Jesus when we are entertaining lustful thoughts? When we lie to our bosses? When we disrespect and dishonor our parents? When we mock and deride? I don't doubt the author of the song would answer with a resounding: not at all!
What, ultimately, does this matter? Is it possible the authors of these two songs were speaking with poetic license? Are we not allowed freedom to understand the heart of a song or message, disregarding its technical accuracy?
First of all, I believe the primary motives behind these two songs (judged by the words used) were this:
1. God's love for people is awe-inspiring and unfathomable. The expressions of His love in redeeming the lost are beyond all comprehension, and merit worship and praise.
2. In Christ, all existence is sustained and the changes inspired by the work of the Holy Spirit move us to a greater understanding of the Lord's presence in our lives.
It's possible I've completely missed the mark in interpreting the underlying intent of these songs, but I do wish to give the authors the greatest benefit of the doubt.
Unfortunately, we cannot afford such inaccuracy in the Church.
In Romans 14, Paul provides a strong imperative to those in the church who are "stronger."
A corporate service, however, has no such freedom. Ministers and music leaders have no knowledge of the overall maturity of the congregation. In point of fact, they would be safe to assume a wide variety of wisdom, knowledge, and maturity in the local church body. With this in mind, is it reasonable to offer up songs of praise which do not, strictly speaking, adhere to truths in Scripture? Is it more important to elicit a certain emotional reaction, inspired by well-meaning words, regardless of their validity?
To both questions, I would purport, "no." During the local church services, we have a responsibility (one which I fell short of consistently in my previous times in various worship bands) to speak, preach, and sing the truth. God should and will be worshiped in truth (John 3:23-24).
Another song I remember from these days (again, please look up the lyrics if you're interested) came to our college group from a source I don't remember (I believe it's a Vineyard song, though I'm not positive). It was called "Every Move I Make." In summary, the underlying theological statement was (in accordance to the first line of the song), "Every move I make I make in You, You make me move Jesus."
Two interesting points are being made, during a church service, sung by a congregation to God Who sits upon His throne.
Before I proceed to examine these two songs and their theological ramifications, let me first state this unequivocally: I don't believe there was any intention upon the authors of these songs to cross theological or doctrinal boundaries. Most artists speak from the heart and the seat of their emotions (something which will be addressed later), and their motives often stem from sincerity and openness.
This said, there are two fundamental problems with these two songs, which can be traced (somewhat haphazardly, I'll admit) to a single issue.
More than Anything?
First, let's consider these words: "God loves people more than anything." We know one of the perfections of God is His love. I John 4:7-8 states explicitly,
Beloved, let us love one another, for love is from God, and whoever loves has been born of God and knows God. Anyone who does not love does not know God, because God is love
The nearsighted, and incomplete human experience we know as "love" finds its perfection in God and God alone. Within Him alone does love manifest itself to its fullest extent for because it is an attribute (for lack of a better word) He permits us to experience and apprehend. We do well to consider the love from the Lord and the means in which He reveals this to us.
But the primary theological point of the song isn't the reality of this attribute of God. It pertains to the direction of this particular attribute flowing in its fullest measure from top-down. God's love, according to the song, is expressed only in its perfection after mankind's creation and fall. In essence, God loves people more than anything.
Is this, strictly speaking, true? Does God love mankind more than anything? Does He love us more than Himself? Is there a lack in the unity and perfection of our Triune God in which He must seek the final expression of His love in something other than Himself? I would posit this to be absolutely impossible, bordering on the absurd. To say God loves mankind (fallen or otherwise) either places upon the Lord imperfection or mutability, both of which are Scripturally untenable.
Imperfection
What was God's state prior to the creation of mankind? Such a question is, of course, impossible for us to answer. Before our appearance, we have no knowledge of God's work or expression of Himself. In Scripture we are given glimpses of Him in His eternal Being; we read of occurrences (e.g. Satan's rebellion) in a spiritual reality of which we are not capable of interacting; we are even given insight into certain attributes of God which provide us with imperfect understanding of Who He Is. But, we are not given any glimpse into eternity-past.
Unfortunately, if we are to posit God's love for mankind exceeds His love for anything else, we must first attempt to grasp this as it relates from God as an eternal Being. Does God love us more than Himself? If so, what was the state in the Trinity prior to His creation of mankind? Was there an impenetrable barrier in which God could not express His love in its fullest to Himself? We know the Father loves the Son (John 5:20); was this love incomplete in eternity-past? Did the love of God (a fundamental attribute of His Being, according to the apostle John) grow in greater measure upon this one creative act? If so, this redefines God into a God of development and evolution.
Rather than God being complete within and of Himself, we are forced to accept a God Who, upon the creation and fall of mankind, experienced an altering in the fullness of one of His attributes, the result of which was the fullest expression of love being bestowed from the Creator to the Creator.
Mutability
If we reject the previous assertion (as we should), the next question arises: What was the cause of such change upon the advent of fallen human beings? Did the Lord redirect the expression of His love in its fullest away from Himself (within the Trinity) to His creation? Is there any Scriptural precedence for such a position? According to Scripture, there is not. God has repeatedly revealed Himself to His creation as unchanging and immutable (Malachi 3:6). Unfortunately, this truth as ascribed by Scripture is incompatible with the statement, "God loves people more than anything." If the fullness of God was complete in eternity-past, and God reveals Himself as unchanging, then we can, logically, rely on His completeness after the creation of mankind. To do otherwise results in the same error as previous: God becomes a being of evolution and progress, rather than perfection and completeness.
Every Move I Make?
Scripture is quite clear regarding the eminence of Christ (Colossians 1:15-20):He is the image of the invisible God, the firstborn of all creation. For by him all things were created, in heaven and on earth, visible and invisible, whether thrones or dominions or rulers or authorities—all things were created through him and for him. And he is before all things, and in him all things hold together. And he is the head of the body, the church. He is the beginning, the firstborn from the dead, that in everything he might be preeminent. For in him all the fullness of God was pleased to dwell, andAW)"> through him to reconcile to himself all things, whether on earth or in heaven, making peace by the blood of his cross.In Christ, all things are held together. He is the Word of God, present during creation and in Him all things find their life and existence. This is a truly remarkable revelation, providing even greater insight (and therefore inspiring praise and worship) into the creative acts of God (Genesis 1 and 2).
So what's wrong with this statement: "every move I make I make in You, You make me move Jesus"?
The answer is simple: Jesus is not the author of sin, and, therefore, is not present in every act we make. He does not make us move in certain contexts and sinful expressions of our fallen nature.
Scripture is quite clear about the dangers of either ascribing sin to the Lord, or finding means to justify sin with theology (Romans 3:8). According to Romans 5, sin entered into this world through one man, not through an act of the Lord. Justification and redemption from the curse and enslavement of sin has been given through the direct intervention of God, and by these means we are set free. This, however, does not preclude the continued existence of sin.
In lecturing on Romans, Martin Luther coined a phrase which resounded throughout the Reformation: simul justus et peccator. This statement referred to the regenerated nature of sinful man: "simultaneous justified and sinful." Paul's statements in Romans 7 attest to this reality: though fully justified in the righteousness, and death and resurrection of Christ, he still experienced the daily struggle with sin and a nature which is bent away from the Holiness of God.
What does this song commonly used in church services and college groups say about this? It states, without equivocation, every move we make is in Jesus. Quite strictly speaking, this is a preposterous statement. Was Paul's lament regarding his inability to do right a condemnation of Christ moving him to do wrong? Of course not. Indeed, in verse 25 he breaks out into praise of the One in Whom righteousness and justification is found.
The words of this song beg a question: are we moving in Jesus when we are entertaining lustful thoughts? When we lie to our bosses? When we disrespect and dishonor our parents? When we mock and deride? I don't doubt the author of the song would answer with a resounding: not at all!
So What's the Point?
What, ultimately, does this matter? Is it possible the authors of these two songs were speaking with poetic license? Are we not allowed freedom to understand the heart of a song or message, disregarding its technical accuracy?
First of all, I believe the primary motives behind these two songs (judged by the words used) were this:
1. God's love for people is awe-inspiring and unfathomable. The expressions of His love in redeeming the lost are beyond all comprehension, and merit worship and praise.
2. In Christ, all existence is sustained and the changes inspired by the work of the Holy Spirit move us to a greater understanding of the Lord's presence in our lives.
It's possible I've completely missed the mark in interpreting the underlying intent of these songs, but I do wish to give the authors the greatest benefit of the doubt.
Unfortunately, we cannot afford such inaccuracy in the Church.
In Romans 14, Paul provides a strong imperative to those in the church who are "stronger."
Therefore let us not pass judgment on one another any longer, but rather decide never to put a stumbling block or hindrance in the way of a brother.We are given clear instruction to promote maturity and understanding upon those who are spiritually weaker in the Church. Such weakness may pertain to issues of freedom versus license, times of worship, or doctrinal struggles. Such weakness may also stem from simple ignorance brought upon by spiritual immaturity. Such ignorance should be met with loving knowledge and grace. For these, we must be quite careful not to introduce a Gospel which conflicts with that given by Scripture. Individuals in moment of personal, songful worship may understand the finer nuance of intention in the two, previously mentioned songs. We might hesitate to offer words which are clearly untrue in worship, but this is a point for a different topic. Regardless, spiritually mature believers may be able to distinguish between the true and the hyperbolic.
A corporate service, however, has no such freedom. Ministers and music leaders have no knowledge of the overall maturity of the congregation. In point of fact, they would be safe to assume a wide variety of wisdom, knowledge, and maturity in the local church body. With this in mind, is it reasonable to offer up songs of praise which do not, strictly speaking, adhere to truths in Scripture? Is it more important to elicit a certain emotional reaction, inspired by well-meaning words, regardless of their validity?
To both questions, I would purport, "no." During the local church services, we have a responsibility (one which I fell short of consistently in my previous times in various worship bands) to speak, preach, and sing the truth. God should and will be worshiped in truth (John 3:23-24).
Wednesday, August 5, 2009
Flex and Pure MVC
I learned PureMVC for Flex about a month ago, and was able to successfully migrate all of my Flex projects at work to this new framework. Of course, these projects are relatively small (appx 5000 lines of code at best) but it was the best move I could have made.
Though PureMVC doesn't necessarily guarantee good design and separation of concerns in a project, it certainly provides a nicely decoupled way of utilizing the MVC design scheme.
PureMVC uses what's called a Facade to act as a broker for forwarding notifications from various components. View components (MXML and the ActionScript needed to drive them) are provided to "Mediators" which communicate via the Facade. These mediators translate any events from the UI (e.g. users clicking buttons to load information from a server) into "notifications" which are sent via the Facade to the respective Controller objects.
These Controller objects are known as "Commands". Commands receive the notification from the Facade (and any data passed from the View components) and then use "Proxies" to request data and perform the majority of the business logic for the application.
Sound complicated? It's really not. The typical project may be organized like this:
src
|- controller
|- model
|_ view
Under the "controller" directory, Commands are kept which receive notifications. These commands invoke "Proxies" which are stored in the "model" directory. These proxies request information from remote objects (e.g. servers) and relay data back to the appropriate location. The "view" folder contains two different types of objects: view components and mediators. The view components are simply the user-visible forms and controls in which the user interacts. These have absolutely no connection to any PureMVC components; rather, they are passed (at runtime) to a "Mediator". The mediator listens for events from the view components and then relays the event to the Facade as a notification.
Frankly, it sounds a lot more complicated than it is. Future posts should have some examples for how to assemble a simple User-form in PureMVC
Though PureMVC doesn't necessarily guarantee good design and separation of concerns in a project, it certainly provides a nicely decoupled way of utilizing the MVC design scheme.
PureMVC uses what's called a Facade to act as a broker for forwarding notifications from various components. View components (MXML and the ActionScript needed to drive them) are provided to "Mediators" which communicate via the Facade. These mediators translate any events from the UI (e.g. users clicking buttons to load information from a server) into "notifications" which are sent via the Facade to the respective Controller objects.
These Controller objects are known as "Commands". Commands receive the notification from the Facade (and any data passed from the View components) and then use "Proxies" to request data and perform the majority of the business logic for the application.
Sound complicated? It's really not. The typical project may be organized like this:
src
|- controller
|- model
|_ view
Under the "controller" directory, Commands are kept which receive notifications. These commands invoke "Proxies" which are stored in the "model" directory. These proxies request information from remote objects (e.g. servers) and relay data back to the appropriate location. The "view" folder contains two different types of objects: view components and mediators. The view components are simply the user-visible forms and controls in which the user interacts. These have absolutely no connection to any PureMVC components; rather, they are passed (at runtime) to a "Mediator". The mediator listens for events from the view components and then relays the event to the Facade as a notification.
Frankly, it sounds a lot more complicated than it is. Future posts should have some examples for how to assemble a simple User-form in PureMVC
Saturday, June 20, 2009
Conky version 1.0

It's finished! I'm still working on some details: the icons are ok, but I wonder if I could cut this down a bit. I also want to divide this up to all 4 corners of my screen.
Anyway, this is the conky in #! on my laptop. The smudged content in the top is my hostname 'on' my ESSID. If the ESSID isn't available (e.g. no wireless connection), it prints "
Friday, June 19, 2009
Friday, June 12, 2009
Dependency Injection and Flex
So, a quick note on the progress I've made with Flex. First of all, I wanted a tool to highlight text. So...I spent 3 weeks working through tutorials and examples from some brilliant coders who have already paved this way, worked with several different libraries, and finally found that all my work was for naught; enter, FlexLib. It not only had a great highlighting class, but also contained some moveable Panels, and a nice extensible Tab Navigator...sigh..all that work down the drain.
Anyway, I've heard about Dependency Injections a lot lately, and I finally decided to research what it's about. Wow, I never realized how simple a concept it would be. Having been exposed to different design patterns like Factory Method, this was extremely easy to assimilate.
Dependency Injection works very well with Flex interfaces, and particularly well with Factories. If I have an object A which depends on object B, I could have A instantiate B and maintain a reference to it. Unfortunately, this creates a dependency within A upon B:
In this case, A has a definite dependency upon B's implementation. If B changes 'foo()' to anything else, A will break.
We can partially solve this via a interface, in which A and B agree on B's required methods. In this case, B utilizes an interface, BI, which instructs B to always implement 'foo()'. Thus, A can access B via its instance:
But we still have a problem: A is still relying on the base class of B. What if we wanted to break B into different objects, and 'B' was no longer a valid name? Moreover, what if we moved B to a different library? Enter a factory.
Rather than A creating B, even via its interface, what if the code calling A passed in a reference to B, via its interface? For this, we'll add two new classes. 'Factory' has a 'createBI' function that returns a reference to B via its interface, BI. FooBar is a class which creates A. In this class, the code to create A might look something like this:
Whereas the constructor for A might look like this:
From this point, we've broken the dependency of A to B, and created a new dependency from A to BI. This is a better design and is more extensible: should we need to have different variations of B, as long as they implement the BI interface, A can utilize them.
What's more, 'FooBar' injected the dependencies into A.
That's all there is to it.
Now...my question is...how far can you take this??
Anyway, I've heard about Dependency Injections a lot lately, and I finally decided to research what it's about. Wow, I never realized how simple a concept it would be. Having been exposed to different design patterns like Factory Method, this was extremely easy to assimilate.
Dependency Injection works very well with Flex interfaces, and particularly well with Factories. If I have an object A which depends on object B, I could have A instantiate B and maintain a reference to it. Unfortunately, this creates a dependency within A upon B:
private var bInstance:B;
...
bInstance = new B();
bInstance.foo();
In this case, A has a definite dependency upon B's implementation. If B changes 'foo()' to anything else, A will break.
We can partially solve this via a interface, in which A and B agree on B's required methods. In this case, B utilizes an interface, BI, which instructs B to always implement 'foo()'. Thus, A can access B via its instance:
private var bInstance:BI;
...
bInstance = new B();
bInstance.foo(); //guaranteed since bInstance is an instance of type BI
But we still have a problem: A is still relying on the base class of B. What if we wanted to break B into different objects, and 'B' was no longer a valid name? Moreover, what if we moved B to a different library? Enter a factory.
Rather than A creating B, even via its interface, what if the code calling A passed in a reference to B, via its interface? For this, we'll add two new classes. 'Factory' has a 'createBI' function that returns a reference to B via its interface, BI. FooBar is a class which creates A. In this class, the code to create A might look something like this:
a = new A(Factory.createBI());
Whereas the constructor for A might look like this:
private bInst:BI;
public function A(bInst:BI):void {
this.bInst = bInst;
}
From this point, we've broken the dependency of A to B, and created a new dependency from A to BI. This is a better design and is more extensible: should we need to have different variations of B, as long as they implement the BI interface, A can utilize them.
What's more, 'FooBar' injected the dependencies into A.
That's all there is to it.
Now...my question is...how far can you take this??
Sunday, April 12, 2009
Happy Easter -- Christ is risen indeed!
What a wonderful time of the year for us, as Christians, to remember the glorious resurrection! We worship on Sundays because this was the day of Christ's resurrection from the dead, but it's also, in my mind, important to set time aside on the anniversary of our blessed hope.
I've been thinking about the resurrection more this past year, and I have a thought: one of the strongest proofs of Christ's resurrection lies in the changes the Holy Spirit wrought in the lives of His disciples and those who lived in the ancient world.
At the time of Christ's death, His disciples had fled. The oligarchical religious authorities had, it seemed, succeeded in squelching what they viewed as a blasphemous trend and an affront to their authority. Jesus' friends had abandoned Him immediately after His arrest, and, on that Sunday so long ago, were in hiding. They feared the reprisal of the authorities against those Jesus had taken into His "inner circle," so they sat in their rooms, cowardly and afraid for their own lives.
Don't get me wrong -- I would have done the same...we all would have.
But, within a very short amount of time, these men swept through Israel, Palestine, Asia Minor and to even farther reaches of the known world, spreading the glorious news of Christ's death and resurrection and forgiveness for sin. They baptized and made disciples wherever they went, turning the Jewish society completely on its head. Those who had lived and breathed a fiercely xenophobic and merit-based religious lifestyle were now proclaiming the forgiveness of sins fully apart from works to those outside their respective society. Faith and belief were no longer restricted to a few select practitioners, men, women, soldiers, etc. Instead, all, even small children, were welcomed into the Church.
For those who would purport the existence of explicit "misogynism" in the early church, I would ask they read the New Testament and consider the words of Christ, Who, in a strictly patristic society, reached out to women with His teachings; as well as the apostle Paul, who, though recognizing the difference in role and responsibility between the sexes, also acclaims specific women working alongside men in the church. I would also encourage them to compare Christianity in its day to the other religious institutions at the time: it stands apart in its acceptance of all from different walks of life, and its claims of the abject uselessness of meritorious acts.
In a very short amount of time, the world was drastically and fundamentally changed. No longer basing their religious standing on their capacity to keep Law, give charitably, or act in accordance with goodness, Christians were, rather, displaying chartity and good deeds stemming from an inward change. Rather than working to earn merit, their focus was on being thankful for a gift given while they were still sinners (Romans 3:8), and spreading this good news to everyone they came near.
Christianity spread like a wild fire in its early days, in the face of the most perverse and grotesque persecution and opposition known to man. Under the reign of Domitian, Christian persecution became a matter of state policy; under the reign of Nero, Christians were tortured and ravished as a matter of entertainment. The Jewish religious authorities persecuted and murdered early leaders of the Christian church, casting others into jail.
We know the tomb is empty. Christ rose from the grave (halleluiah!) and we in Him we have a blessed hope. But we need remember one thing: no explanation, no physical evidence, no arguments are sufficient to explain this unprecedented phenomenon. It's not enough for the world to present Jesus' bones and say, "here he is!" Such an occurrence falls drastically short of the historical evidence we have of such a massive personal transformation on behalf of His followers.
What more can we ask for? The proof of Jesus' resurrection and His sending the Holy Spirit need not lie in manifestations of "spiritual gifts;" it need not be sought in an "experience" or a "feeling" or emotion; it need not be based upon the display of miraculous "healings" during televangelist gatherings. Though I don't discount gifts, feelings, or the power of the Lord to heal, we far too often seek for reassurance of His reality in things which focus us inward:
He has risen indeed!! Happy Easter!!
I've been thinking about the resurrection more this past year, and I have a thought: one of the strongest proofs of Christ's resurrection lies in the changes the Holy Spirit wrought in the lives of His disciples and those who lived in the ancient world.
At the time of Christ's death, His disciples had fled. The oligarchical religious authorities had, it seemed, succeeded in squelching what they viewed as a blasphemous trend and an affront to their authority. Jesus' friends had abandoned Him immediately after His arrest, and, on that Sunday so long ago, were in hiding. They feared the reprisal of the authorities against those Jesus had taken into His "inner circle," so they sat in their rooms, cowardly and afraid for their own lives.
Don't get me wrong -- I would have done the same...we all would have.
But, within a very short amount of time, these men swept through Israel, Palestine, Asia Minor and to even farther reaches of the known world, spreading the glorious news of Christ's death and resurrection and forgiveness for sin. They baptized and made disciples wherever they went, turning the Jewish society completely on its head. Those who had lived and breathed a fiercely xenophobic and merit-based religious lifestyle were now proclaiming the forgiveness of sins fully apart from works to those outside their respective society. Faith and belief were no longer restricted to a few select practitioners, men, women, soldiers, etc. Instead, all, even small children, were welcomed into the Church.
For those who would purport the existence of explicit "misogynism" in the early church, I would ask they read the New Testament and consider the words of Christ, Who, in a strictly patristic society, reached out to women with His teachings; as well as the apostle Paul, who, though recognizing the difference in role and responsibility between the sexes, also acclaims specific women working alongside men in the church. I would also encourage them to compare Christianity in its day to the other religious institutions at the time: it stands apart in its acceptance of all from different walks of life, and its claims of the abject uselessness of meritorious acts.
In a very short amount of time, the world was drastically and fundamentally changed. No longer basing their religious standing on their capacity to keep Law, give charitably, or act in accordance with goodness, Christians were, rather, displaying chartity and good deeds stemming from an inward change. Rather than working to earn merit, their focus was on being thankful for a gift given while they were still sinners (Romans 3:8), and spreading this good news to everyone they came near.
Christianity spread like a wild fire in its early days, in the face of the most perverse and grotesque persecution and opposition known to man. Under the reign of Domitian, Christian persecution became a matter of state policy; under the reign of Nero, Christians were tortured and ravished as a matter of entertainment. The Jewish religious authorities persecuted and murdered early leaders of the Christian church, casting others into jail.
We know the tomb is empty. Christ rose from the grave (halleluiah!) and we in Him we have a blessed hope. But we need remember one thing: no explanation, no physical evidence, no arguments are sufficient to explain this unprecedented phenomenon. It's not enough for the world to present Jesus' bones and say, "here he is!" Such an occurrence falls drastically short of the historical evidence we have of such a massive personal transformation on behalf of His followers.
What more can we ask for? The proof of Jesus' resurrection and His sending the Holy Spirit need not lie in manifestations of "spiritual gifts;" it need not be sought in an "experience" or a "feeling" or emotion; it need not be based upon the display of miraculous "healings" during televangelist gatherings. Though I don't discount gifts, feelings, or the power of the Lord to heal, we far too often seek for reassurance of His reality in things which focus us inward:
- I have this gift
- I feel this feeling/sensation
- I was healed
He has risen indeed!! Happy Easter!!
Subscribe to:
Posts (Atom)
