Translate To Preferred Language

Search Obioku's Thoughts

Please Read Today's Featured Post

Things I Would Like To Happen Soon

For all those who believe in speaking ideas into existence and prayer in the universe will return to a person.  I simply want to write a lis...

Sunday, May 22, 2016

Reflecting Heroes & Villains

I wanted to share two of my favorite comic book characters in this entry.  This is partially due to the popularity of superhero movies in the last decade.  These successes have come from the Marvel and DC brands.  There is one villain and one hero I feel paranormal connection to from each.  Though I cannot really explain it, I will try my best to say what I like about each.  The sentimental significance of these beings are predetermined with the labels assessed to them.  So it is easy to want to see the hero win and the villain lose.  What happens when we begin to want the opposite instead?  What happens when the momentum shifts or never starts in some ways as we root against the written nature?  It’s disorientating but it is still entertaining at the end of the day.  Who knows maybe one day I could portray one of them in a movie which has not been done in a full-length film to date. 

The hero is Cable from the marvel universe.  Cable has many powers including superhuman strength, telepathy and time-traveling capabilities.  Now I do not have any of those abilities per se but that is not the whole story.  Cable is the prototype of the antihero.  The troubled individual with an obligation to do good even if it requires bad actions.  He also battles a techno-organic virus which has already complicated him by disabling some of his body.  But the disease has not defeated his evolved martial arts and weaponry skill which is used so masterfully to combat his enemies.  My favorite attribute of Cable also includes baby hope.  Hope is a character who has mankind’s fate placed upon her at a very early age.  Cable sees this potential and protects her by keeping her close.  At times, he evens places her in a sachet of sorts on his chest.  The symbolism of this is the “hope” is always near and constantly growing with us.  We have to nurture and shield her to allow her to reach her predefined destiny. 

The villain is different in every way from Cable except for my belief in his core persona.  Brainiac from DC and Superman comics is who I speak of.  Brainiac, as you may deduce, has superior intellect that separates him from nearly every character in his presence.  He is an expert of almost every science known to man and human behavior.  Its a moiling mystery to ponder whether mental capacity led to his evil nature or if the sequence was in reverse.  Villain roles are more intriguing as you have to reveal why someone chooses the other side.  The hero usually experiences something that makes them want to stop anyone else from going through or feel senses to perform good given their unique abilities.  Villains however use their greater prowess to reinforce the idea of inferiority in their quest to conquer.  The dichotomy alone is captivating.  Brainiac is very advanced and has several forms that appear throughout his tenure as an adversary.

The two characters chosen have few things in common as previously stated.  Cable is far less known than the likes of Wolverine, Spiderman or Ironman just to name a few.  However as in all comics, he is the sun of which his universe revolves.  In his world he is the featured main character and plays a lesser or secondary role for others as a special guest in theirs.  To break down the character in real life may show a person with great resilience, the power to read thoughts or another way of saying it is an enhanced value for anticipation.  Time traveling can be translated into directing the future and defining or encapsulating the past.  And we can always protect those close to us, those we believe in and those we connect to.  Brainiac is the nemesis of one of if not the most popular character ever.  His supreme intellect is a perplexing balance to all of Superman’s gifts.  Speed and strength can be counteracted with genius.  But more than anyone’s competencies or proficiencies are their desire to assist or destroy at heart.  That is essentially defined as good and evil until we place a mirror at the scene and you can finally see the other.  It gets comedic in a sense when all your plans for world domination are foiled by some annoying being who’s always there.  Or when you have nothing to do as people can handle their own issue.  You are reduced to just having fun with your mutated powers.  Both sides need each other but the decisions that play into the division are the most important story to tell.  And every iteration of the contrast of forces is something to write about.

Friday, May 20, 2016

Object-Oriented Programming and Design


Abstract
Object-oriented programming was created with coders and designers in mind.  It has expanded to many different languages as it has proven to be efficient and sustainable among the options that are available today.  The main concepts of encapsulation, abstraction, inheritance and polymorphism are the core principles this idea.  Building large structures into small manageable objects with multiple capabilities is the valued philosophy of object-oriented programming.  Since its early days at the Massachusetts Institute of Technology, it has become an industry standard and will remain relevant for years to come [1].
Introduction
Object-oriented programming and design is a topic that covers many of the modern languages we use today.  The focus of object-oriented design, in my opinion, is to create forms of data to be reused.  Java has the slogan “write once, run anywhere” which helps my definition.  Java is a class-based language, introduced in 1995, that is one of the better examples of being able to perform all the ideas of object oriented programming [1].  To define a class with variables and methods means you can then create an object of that class to use in your programming.  It can be used in the current program and if you need to reuse the concept, it can be reincorporated into another program without having to be rewritten.  That is the beauty of object-objected programming and design.  It places emphasis on the coder to feature the abilities of encapsulation, abstraction, inheritance and polymorphism for optimization of the language [2].  These are coding principles specifically for this type of programming that I will discuss more later on in detail.  The term object-oriented began in the early 1960’s in MIT with the development of the LISP language.  I would prefer the languages of COBOL, Visual Basic and Java as examples of implementation since I have more experience with them personally.  I had a course devoted to each while enrolled at Frostburg State University as an undergraduate student.  COBOL stands for common business oriented language actually.  After appearing in 1959 after being generated with government assistance, COBOL is thought of as a procedural language by many [3].  It can be used to generate forms and report on data related to business interactions.  However with the ability to create variables and invoke classes, I will use it as an early example of an object-oriented one.  Visual Basic is considered an event-driven language.  Primarily user create a graphical user interface and then decides what can happen once certain events are triggered.  Events can be defined as the user interaction with the form such as once the mouse is clicked or a button is selected.  Whenever something happens the application should have a response.  Again, I will use it to show some of the OO capabilities that can be found in that as well.  Also let me introduce some terms that I will use throughout my writing.  Variables are individual allocations of memory of a certain data type which can have value assign to them.  Data type are the form of the information.  Some of the common examples are integers for numbers, chars for individual alphanumeric characters, string for multiple alphanumeric characters and Boolean for true or false value also known as either the one or zero bit.  Methods or procedures are a series of commands or instructions that will take place once it is called or activated.  Classes are container elements of some combination of the previous two programming concepts that can then be treated as an object.  It is important to know these definitions before we go much further on the nature of this topic.  From an expert’s point of view this may be fundamental but I will try to write from the perspective of a novice so it may be appreciated by a wider audience.
Encapsulation
One of the first components I will discuss is encapsulation.  Some may call encapsulation the process of concealing parts of your program.  I prefer the slightly lighter view of building capabilities into your objects.  It can be as simple as assigning a value to a variable.  Instead of consistently working with a constant value, you can define a place holder to use throughout your program.  As I said, that is the simpler view that can be performed in COBOL, Visual Basic and Java but each does it in a different way.  COBOL uses the pic keyword to assign value to variables in its data division [4].  In visual basic coders use the dim keyword to name the variable and then what type it is.  Java you have to give the type then its name.  For VB and java you can use the ‘=’ operator to place a value upon it.  The more complex side is to create class with its own methods to use.  In java it is common to use encapsulation.  Using class objects to perform specific tasks is a major component to the language.  Creating the objects of your own volition is the more hands on approach.  Within the class you can identify variables and methods which it will use.  There is another aspect of the constructor to deal with as well.  A constructor is called when the object is first instantiated using the new keyword.  Constructors can accept a value or not but what happens in either instance will have to be defined by the coder.  Once the object of the class is usable, you can then interact with its variables and methods as you wish.   Therefore is the main coding section, you can use the object and refer to its contents instead of add that section of code to the main portion.  Depending on the object this can be easier for you and would be the same without encapsulation.  For instance, you can code a method to perform a loop.  This loop could have been created in the main source code.  However, if you were to call it multiple times, it would be relatively simpler by calling the method several times and writing the steps and iterations of the loop once. 
Abstraction
Abstraction, in my opinion, is the middle step between encapsulation and inheritance.  Not the middle in terms of the creation process but it can use encapsulation to lead to inheritance though it is its own concept.  The word abstraction is the quality of dealing with ideas rather than events.   The translation is near perfect because for programmers it is creating the skeleton of a class.  The initial abstract object only incorporates the fundamental framework of what will be used.  Reduce the object to the bare minimum that is required for it to exist.  The class can be absorbed by another class that can then define what its variable contents would mean and its procedures would do.  You can create the class by telling what the types of variables are and the names of the methods only.  Just the frame work is necessary for initial processing which makes abstraction unique.  The ‘hello world’ example is shapes.  You can model an abstract class or interface of shape with variables for height and length and then methods of draw, perimeter and area.  The idea is that all shapes have these properties but they will be defined differently.  The coder can design classes like circle, square, rectangle and triangle that share these same attributes though they are not handled identically.  Each can assign height and length but how they are formed using draw and how the area of the shape is calculated will have to be defined in each class while they use the same name or ‘area’.  Area for circle is half length multiplied by pi, square can be length to the power of two, rectangle can be length multiplied by height and triangle can be half the length multiplied by height.  This is an example of abstraction only because the theoretical parent class has nothing defined in it.  If we were to define any of the parameters in the parent class, it would have to be redefined by the child class which is not optimal to the concept.  For shape there are no universal properties accept the names of its contents not the values. 
Inheritance
Abstraction leads to the topic of inheritance.  Inheritance has parent and child classes.  The parent class will be defined and then the child can inherit those capabilities and add to them if it needs to.  Inheritance lends itself more to the idea of a hierarchal structure than that of abstraction.  Though the two are very similar, the idea behind inheritance is opening the door to use some of the predefined attributes of the parent class.  Usually in inheritance that entire object will not have to be redefine.  Users can do this in two ways.  One is to inherit the parent class and not redefine a specific detail.  This would confirm that you wanted to use the parent definition for the child because some of its traits can be carried over.  Another in java is to call the parent in the child using the super constructor option.  In contrast to the shape example, I will try to discuss vehicle.  Now vehicle in these terms will refer to an automobile.  The vehicle will have four wheels, take gas, have glass windows and require one driver.  Those traits can all be passed to children coded as sedan, truck, van and sports car.  Within the children will holds information like top speed, number of passengers, number of doors and off-road capability to name just a few attributes.  Now those can be variables of the parent that are not defined or only belong to each child.  That would be the choice of the coder.  Either will suffice.  Those are examples of variables.  Some methods would be to drive forward, reverse, turn and park.  If the designer wanted to be specific I supposed the size of the vehicle could be incorporated into park so each child would define it by the type of car it is.  Moving the vehicle can be defined in the parent and still called by the child. 
Polymorphism
Sharing certain properties transitions to the subject of polymorphism.  Polymorphism describes similar things existing at the same time.  That can mean variables, methods or even class objects.  Variable and methods can be determined by scope.  Scope entails range in a program where something can be used and is identifiable.  For a variable to be out of range says that it is no longer in the range of which it was instantiated.  You can either recreate the variable for the current context or see if there was another error in the coding.  An example of this is to create a variable to use within a looping algorithm.  If a variable is created in the loop itself, it can be used in the loop.  Once the loop ends, the value that the variable held will no longer be in memory.  Then the variable can be recreated with the same name and used with a different value.  Methods can show polymorphism using the abstraction example.  Calling the draw method for each shape a similar concept.  You can theoretically line up each shape using the draw method in succession.  Rectangle draw, circle draw, triangle draw and square draw will each respond with what it is designed to do.  Though they have the same name and can be contained in the shape class, each shape’s draw will only respond to the class that requested it.  This can be confusing but if the class object is used to identify the method then it makes it easier.  Classes can have more than one object as well.  Using the inheritance example, if I wanted to name vehicle as specific makes or models that can be done using the same class.  Instead of naming my sedans one and two, I could name them honda_accord and toyota_corolla.  In most programming languages the underscore will have to be used connecting the two words to avoid errors.  Both can be sedan and both can have some differentiation used when assigning some values to the variables. 
Conclusion
Object oriented programming has really assisted designers advance coding with its definitive properties.  How encapsulation, abstraction, inheritance and polymorphism are used brings a new significance to programming.  Building new objects with classes that can be defined and processed as data types is remarkable.  It can provide a first-hand level of control with incomprehensible depth of the ability to create whatever you feel possible in your imagination.  Speaking as of today, it may not be the revolutionary concept it was when it was first introduced.  The concept of its intention has remained at the forefront of how programming is performed by professionals and taught by professors.  Since I am not as advanced as others of this genre, I cannot expound on areas of weakness or where improvements can be implemented.  Learning about these forms of subjects can allow the ability to compile all the informational resources within your own comprehension but execution requires a different level of mastery to be fully functional and operational.  
References
[1] https://en.wikipedia.org/wiki/Java_(programming_language)
[2] https://en.wikipedia.org/wiki/Object-oriented_programming
[3] https://en.wikipedia.org/wiki/COBOL
[4] http://cobol.404i.com/content/defining-data
[5] https://en.wikipedia.org/wiki/Visual_Basic