Simple Java Persistence API (JPA) Demo: JPA Query
JPA Query Language
I don’t know if this series still qualifies as simple but I thought I add some basic information about queries in JPA. In part II we looked at the EntityManager and more specifically the simple operations that it enables like persist, find, merge, remove and refresh. In addition to these operations, JPA comes with its own query language that allows you to create custom queries over your data set.
JPA abstracts the developer and the application away from the details of how data is represented in the data stores (more likely a rational database) and this abstraction effectively marries the relational and OO paradigms. However one of the corner stones of the relational paradigm is its query capabilities which has so far been unmatched by any software paradigm to date. The query facilities in the OO model are limited in as far as handling a large amount of data. While there are attempts at developing ORDBMS (Object Relational Database Management Systems) data stores, these have never truly caught on in the enterprise and so the bulk of enterprise data remain stored in relational databases. With every other application build on top of a relational database, it becomes important to build query capabilities into abstractions layers such as the JPA.
The default query language in relational paradigm is the Structured Query Language or simply SQL. SQL has a number of standards defined which every vendor of a relational database implements in slightly different manner thus making it a tricky language to adopt as the basis of an abstraction layer like the JPA that is expected to work across multiple relational database products without resulting to expensive and complex workarounds.
The Java Persistence API Query Language (JPA QL) is the result of attempts to abstract the query facilities of a relational paradigm. It borrows from the EJB QL but also fix the weaknesses that have plagued EJB QL. The specifics of what was borrowed from EJB QL and what was fixed are beyond the scope of this post. JPA provides the ability to retrieve JPA mapped entities, sorting them as well as filtering them. If you are familiar with SQL, then you have some degree of familiarity with JPA QL as it is syntax is closely modeled on SQL’s syntax.
Specifying a Query
There are three main ways of specifying JPA queries:
- createQuery Method of the EntityManager: with this option you compose the query at run time and execute it there and then. The most immediate aspect of this approach to creating queries is that your queries are not checked/parced at deployment time which means that obvious errors are only discovered when the code is executed.
- Named Queries: Named queries are defined along with the corresponding entity beans. Several named queries can be defined for each entity thus enabling filtering and sorting using various properties of the entity. Unlike with runtime queries, these queries are parsed at deployment time which means that any errors are discovered before code is executed that depends on your named queries.
- Native Queries: this gives you the ability to define queries using SQL instead of EJB QL. You can create Native Named Queries as well.
Querying
Retrieving data
The most common query operation is the select operation which returns all or a subset of records in the database. With JPA QL, the select operation returns mapped collection of zero or more mapped entities. The operation can also return properties of a mapped entity. A simple select query looks as follows.
SELECT h FROM Hotel h
SELECT h.name FROM Hotel h
Notice how you select from the entity and not from a table as you would in SQL but the syntax of the query is not different from what you would write using SQL. The query returns zero or many Hotel entities from the database. The Hotel entity was defined in the first installment of this demo series. The second query in the above sample selects a property of the hotel entity.
Lazy vs Eager Loading: FETCH JOIN
When you design your entity classes with associations and relationships, loading and accessing these relationships at run time becomes important. For example, a hotel has rooms and you can decide if you want the rooms associated with each hotel to be loaded when the hotel entity is retrieved (eager loading) or when you explicitly access (lazy loading) the associated rooms. During the definition of the association between entities you can declare whether you can lazy or eager loading but JQL also allows you to load the objects in an association.
SELECT h FROM Hotel h JOIN FETCH h.rooms
With the above query, all the hotel objects returned will have their associated rooms loaded as well. This gives you eager loading without specifying it in the relationship between the Hotel and Room entities.
Filtering & Sorting
It is not always the aim of any data retrieval operation to return every last record in a database; some times we are interested in only a few of those records that meet a particular criteria for the purpose of our operations at hand. Within the context of the simple app setup for this series, we may just be interested in hotels that are in a particular town. The name of the town in question would form our filtering criteria. The sample below gives a JPA QL query that would enable us to retrieve a collection of Hotel entities that with a particular town property.
//Filtering
SELECT h FROM Hotel h WHERE h.name = “Nairobi”
//Sorting
SELECT h FROM Hotel h ORDER BY h.name
//Filter and Sort
SELECT h FROM Hotel h WHERE h.name = “Nairobi” ORDER BY h.name
Once again notice the similarity to an SQL statement that would return rows that meet the provided sort and filtering parameters. So far these are just simple queries that don’t show much of JPA QL capabilities but a necessary step in appreciating how JPA QL queries are written.
Of greater importance is showing how these queries can possibly be composed within the context of Java code.
Query q = em.createQuery(“SELECT h FORM Hotel h ORDER BY h.name”);
List<Hotel> results = q.getResultList();
A further example of using queries to filter
Query q = em.createQuery(“SELECT h FROM Hotel h WHERE h.name = :hotelName”);
q.setParameter(“hotelName”, hotelName);
List<Hotel> results = q.getResultList();
Something that may be a bit tricky for first time users of JPA is composing queries using the LIKE operator to filter
Query q = em.createQuery(“SELECT h FROM Hotel WHERE h.name LIKE :name”);
StringBuilder sb = new StringBuilder();
sb.append(“%”);
sb.append(name);
sb.append(“%”);
q.setParameter(“name”, sb.toString());
List<Hotel> results = em.getResultList();
Assume for a moment that you want a list of all hotels with a particular number of rooms (say more than 20 rooms for example) … here is how you go about formulating such a query:
Query q = em.createQuery(“SELECT h FROM Hotel h WHERE size(h.rooms) > 20 ORDER BY h.name”);
List<Hotel> results = q.getResultList();
This concludes this look at JPA QL. This is not a complete examination of the power of JPA QL but a glimpse at what is possible.
Rising Functional Programming
The expected shift of computer processing to even greater degree of parallelism has sparked interested in new ways of developing software that will take full advantage of the horizontal increase in processing power. The key area that has received the bulk of attention is programming languages and tools. In a many-core world (as opposed to what is now called multi-core), shared state becomes very tricky so most of the mainstream programming languages would be difficult to use in producing software. While almost all the mainstream imperative languages do have a library to enable the development of code capable of parallelism, most of these methods are not baked into the language and sometimes the initial design of the language itself gets in the way. In the design of most of the mainstream imperative programming languages, immutable data type are rare or sometimes completely non-existent all together.
Increased interest in functional programming languages have given rise to new languages that serve as an adequate bridge between the existing imperative programming mindset and the much needed shift to a world of parallelism. Functional programming is certainly not new as many of the techniques have been implemented in languages like Scheme, Haskel, Erlang amongst others. However, these languages and the ideas that they implement have largely remained in academic circles until recently when the software industry has taken a more proactive role to transfer the knowledge of academia to the industry. Programming languages like F# and Scala borrow heavily from the aforementioned pioneers of functional programming.
The newest in this growing list of new programming languages is Google’s Noop. The following is a description of Noop from the project’s web site:
… new language experiment that attempts to blend the best lessons of languages old and new, while syntactically encouraging what we believe to be good coding practices and discouraging the worst offenses. Noop is initially targeted to run on the Java Virtual Machine.
The basic assumptions in the design and development of Noop are certainly interesting. Integrating testing into the programming language can greatly improve code quality and making the language truly object oriented will improve its readability. I have found functional programming languages to have a pleasantly concise syntax that effortlessly achieves what would have required a ton of boilerplate code in supposedly OO languages like Java or C# which include primitive data types.
Who Owns Your Computer Anyway?
On the face of it, that is a rather silly question since within it lies the answer. Software is an important component of your computing experience – without it, you would not have a computer in the first place. However, having installed countless pieces of software of varying licenses, I have come to wonder what an End User License Agreement (EULA) really means.
It is a legal document as far as I can tell so the wisdom of putting it in front of a lay person to indicate (with a handy little button) acceptance or refusal seems rather illogical. I have done my best to try to go through some of these license but the legalese is just too convoluted to make any immediate sense. In a perfect would, you would retain a lawyer who would then break it down accordingly and explain to you what the license means and does not mean. The practicality of matching down to your lawyer every time you want to install a piece of software seems rather counter productive at the very least.
These licenses are an integral feature of proprietary software in that there is a real chance that you may be breaking the law if you don’t abide by the stipulations contained therein. As they like saying, I am not a lawyer but I would expect that for anything to hold in the court of law (more so the act of entering an agreement), the parties should understand what their respective obligations are. Without a lawyer present any chance of making sense of an EULA for a lay person is slim at best.
Once you have installed the software (after appropriately agreeing to the terms of the EULA), do you have ownership of the software that is currently installed on your computer? With a proprietary piece of code, you don’t own it of course hence the EULA is likely to explain that you are not suppose to revise engineer it or temper with it in any way. However, the EULA is likely also to stipulate the if you lose your precious data as a result of using the program in question, the producer of the software is not responsible. Such a situation makes you want to know why exactly you are paying for the software in the first place; for all intends and purposes it may not work as advertised and you have no legal recourse for any such harm that may have result from your use of the software.
And there are software manufacturers whose programs behave more like Trojan horses. You install a single piece of software from a company and the next time you are updating or perhaps even better the software you installed has an auto update feature which periodically checks for updates. Here is the problem, the update would also (in addition to suggesting the new release) install additional, unrelated software on to your machine. In a sense the original program acts like a gateway for the software manufacturer to invite even more software onto your hard disk.
This constant need to out do each other in order to gain the end user’s favor does essentially look remarkably like what a virus writer would do. I recently had to update the Windows Live suite produced by Microsoft and somewhere along the way, I checked a box that would allow me to change the home page and default search engine on my browser which in this case I assume (Since Windows Live is a Microsoft product) would apply to and only affect Internet Explorer. The default search engine for address bar search on my Firefox installation is Bing … no, I didn’t want Bing and there is no simple way of going about undoing settings change. In yet another trespass, I have a .NET plug-in for Firefox installed while in the process of installing something completely unrelated.
With increase competition and jockeying for dominance, major industry players are hacking each other to bits. Google’s decision to integrate their Chrome browser into Internet Explorer using a plug-in seems like a good move on the surface and understandably so but then again there are far greater implication of control and ownership with such a move. As Mozilla points out, it confuses the boundaries between where Internet Explorer is and where things happen because of Chrome’s extension. It is easy to get excited at the thought of Google putting its engineering prowess to work and bringing cutting edge technologies to the most dominant browser in the market but it has far greater implications than just new technologies. The very introduction of new technologies suggests that bugs will be discovered so keeping the boundaries between software components is good as this enables proactive management.
The Windows operating system has a number of utilities that have come up to address weaknesses in the manner in which the operating system runs and manages itself and the programs that has been installed on it. Recently, I had the misfortune of a failed installation – the installation process of a program stopped prematurely and this meant that the program’s uninstaller was not installed. This became a problem that could not easily be fixed using Windows Control panel because I was not able to remove the program. I attempt to reinstall the program in effort to get the uninstaller in place but I was not able to reinstall since the said program has been supposed successfully installed. Just deleting the program would be the most logical thing to do but traces of the software would still remain in the registry and hence lead to a slower system in the long run. This particular situation illustrates a very common problem with most software running on Windows: it is much easier to get a program installed than it is to get it removed/uninstalled properly. There are countless pieces of software that leave their skeletal remains on the hard disk and Windows Registry. Such sloppiness shows a disregard to respect the ownership of the computer hardware on which the software runs – including the operating system.
In closing, users will want and should get the latest and the greatest software available on the market but software producers need to allow users to kick them out of their hard disks and do so with finality and assurance that there are no skeletons left on the hard disk or the registry. Even more importantly, stop with the production of Trojan horses. The fact that I downloaded and use iTunes does not mean that I either desire or want the latest and great version of Safari.
Would you not prefer to have the tools to remain in control of your computer?
The Open Source Movement
In modern times any discussion of open source is bound to stir up the most heated exchange of words, views, opinions and perhaps even insults. Yet what becomes obvious upon a closer examination of the debate is that the people debating the subject either take a narrow view of open source or perhaps just defend a smaller section of it. Increasingly, the debate surrounding open source and closed source is best understood and left as a choice that should be exercised in the presence of circumstance.
What gets lost in the middle of the flame war is the fact that open source is first and foremost a movement that is largely community driven and that espouses the sharing of effort thus requiring that the products of the movement be accessible to all members of the community. Note that such view of open source does not automatically suggest a particular preference and sole domination of IT professionals of varying skills and interests. The nature of the movement and participation in it can accommodate both individuals and large corporations alike.
The very nature of the movement does not require that organizations denounce any other ideologies that they may have so that they can leverage what the open source movement has to offer. Companies like Yahoo, Google and others are heavy users of open source but the largely open and free services that they offer are as proprietary as Microsoft’s Windows and Office Suites. As an example of Google’s proprietary holdings, the company issued a cease and desist order against a participant in the open source community build around Android.
Increased use of open source products to create services also makes the movement much more formidable compared to other competing ideologies – more specifically perhaps ideologies that may come into conflict with particular aspects of open source such as code sharing.
Any mention of the champions of closed source or proprietary software development would bring out Microsoft on top of the list but as a matter of fact Microsoft is no stranger to open source though it is certainly more openly opportunistic and no doubt looks out for its own survival as a money making venture. However over the years, Microsoft has demonstrated exceptional ability to emulate the advantages that naturally occur in the open source movement because of its participatory nature and community approach to software development. Windows 7 has been tested much more widely with Microsoft’s development team actively encouraging feedback so as to continue to make adjustments and improvements. Windows 7 is the most visible example of how Microsoft has managed to create a buzz around a release much earlier on than has been the norm. With most Microsoft products, CTPs (Community Technology Previews) have become much more common in recent years than earlier on.
The need to release software as open source is more often than note a strategic move that is aimed at commoditizing a market. I am not aware of any companies that create a unique or market leading product and choose to release it as open source. Open sourcing usually targets product that do not have market share as yet and/or whose creators are not able to product the support necessary to bring it to any appreciable level of dominance in the market. Once again this practice is used by companies that both espouse closed-source software development as well as those that rely heavily on open source.
Commercial open source is where the business should be and the money making opportunities will and should arise. One of the main feature of closed-source software is that the barrier to entry is usually high such that simple human ingenuity may not be enough to come up with something unique and different. With such barrier to entry open source becomes a fundamentally attractive option for governments whose aim and objectives will and should include the cultivation and development of a software development industry within their respective borders.
Some of the best know companies in the world at the moment had their start from universities and schools. Yes, Microsoft does offer access to their source code for academic research but how possible is it to come up with products and/or services that build on your knowledge, understanding and modification of Microsoft provided access to the said source code? This is perhaps one of the reasons why any of the more recent start ups tend to built their infrastructure on open source tools and platforms. Microsoft is certainly aware of this and have had a number of initiatives that are targeted at students to encourage them to build their businesses on Microsoft technologies and tools but such efforts will be limited by how well Microsoft can tap into and harness a sense of community and adventurous exploration of their platforms with the possible benefit of making it to the big leagues as has been proven by the current darlings of social networking that have been started at campus dorm rooms using available and accessible open source tools and platforms.
While Microsoft’s and other proprietary companies’ efforts to encourage students to look at their platform and build on it does offer the semblance of openness, they remain both myopic and deeply miss guided. Take an example of any third world country and pose this question: how likely is it for a country to have a Windows Kernel expert? It is not at all impossible but how practical is it to cultivate such level of expertise? How much effort would it take to nurture and grow a Linux/BSD kernel expert in any third world country? Given the nature of source control and management at a proprietary company compared with the source control in the open source movement, it would be obvious that an open source product is much more likely to spawn a lower level expert on the inner workings of any particular product or service.
In conclusion open source encompasses a lot more than just sharing code and the associated license that dictate how sharing happens. It is, at its core, a movement that can accommodate both corporations and individuals who can identify with the spirit of the movement and hence become members. As a movement there are various roles that require different skills hence everyone with a talent can contribute to the well being of the movement. Open source does provide the best opportunity for governments (third world countries to be exact) to cultivate a vibrant ICT industry within their jurisdiction.
Advantages of Disability
I am generally dissatisfied with the manner in which disability is handled in whatever society though that does not necessarily represent a deliberate effort to take less notice of disability per se. Such disparities manifest themselves in different ways such as the language that is spoken in the society and/or the facilities and assumptions that everyone automatically makes when he/she comes across a handicap/disabled person. Some of the words used to refer to disabled people are derogatory but more often than not is their tendency to emphasize the disability and thus create a certain mental image of someone who is less than he/she ought to be.
In the about section of this blog, I have proclaimed my pride in being handicap/disabled (the specific term does not mean that much to me as an individual handicap/disabled person) person. Today it occurred to me that I have not spent some thoughts in pointing out the advantages of a disability. For the sake of this post, a disability must be a condition to which there are currently no effective cure and specifically physical disability though some of the points that may be brought up can be extrapolated to cover other kinds of disability.
Living with a disability goes beyond the physical manifestation of the handicap since that manifestation will heavily influence how the person concern views life and goes on to live it. In a sense, the fact that a person is disabled means that they need to learn some life skills which are either taken for granted by the normal people who are on the whole irrelevant to them.
Planning & Strategizing
As a physically handicap person, the simplest thing that you can possibly go out of your way to carry out would require planning as there is need to make sure that everything is setup in such a manner as to ensure the success of the mission/task. For example, I have found myself looking for that extra information about the building where I am going (if I have never been there before) because it is important that I know before hand if the building is storied and if so if there are any lifts or stairs. In case there are stairs, then it becomes necessary to establish if there are handrails so that I am able to get to my destination. Of course in the middle of all these considerations, a key point remains what floor my destination is located. The details of the plan is developed for each new trip/mission/task will depend on the kind of disability.
The process of planning any new is accompanied with a desire to ensure that resources such as time and effort are used efficiently. So time and resources are planned to yield the highest possible return. I must admit that this does not always happen but for a handicap person maximizing the returns on any effort expended is always a priority.
Problem Solving
One of the things that handicap people in general are forced to confront is developing solutions that works for their particular situations. As a general rule that enables a better understanding of problems in any given situation and the accompanying effort required to ensure success. I generally avoid exposure to any buildings that are storied and lack stair cases but when I joined university, I had to figure out a way of scaling stairs with two crutches and a caliper. The solution to this particular problem had to assume both the presence of a good Samaritan at the base or top of the stair or the likely possibility that I will find myself alone. The solution I had come up with both addresses these problems but I also had to adjust the rest of my approach to attending classes; of particular interest is carrying back packs as these would increase the load that needed to be moved between floors.
The important skills learnt here as a result of living a handicap life is identifying a problem and defining it so as to develop solutions that address the problem adequately. Of particular interest is that there is a need to ensure a balance between the capabilities of the solution provider and the desired outcome. As in the aforementioned example, the first objective was to ensure that the handicap person retains as much independence as much as possible while solving the particular problem at hand. In any given business environment it would be particularly advantageous to have people who can solve problems within the confines of limited budget and resources. As mentioned in the above example, the solution to the stair case problem retains long term strategic relevance so the ability evaluate the effects on any given choice is much more heightened for a handicap person.
Team Spirit
A disabled person is already limited in one way or the other so he/she would need to depend on someone for support so it is in his/her lifestyle to know when to give control to more capable people. All organizations and employers are interested in team players and more so in team players who can recognize their own weaknesses and strengths and as such bring the whole team together as one continuous group that complement each other towards a common goal. Disability forces a person to see himself/herself in terms of his strengths which are essentially what comprises his/her identity as well as weaknesses which threaten the success of his/her efforts.
It is also important to point out that there are disabled people who may possess the potential for leadership. Leadership combined with a disposition towards team spirit can lead to a high performing group. A leader who is predisposed to engage the team will make decisions that are both beneficial to the team as well as delegate jobs and responsibilities to those who will have the most appropriate skills to bring the most return.
It goes without saying that dealing with organizations, there are other factors beyond the possession of leadership skills as well as a disposition to foster team spirit. Someone with leadership qualities would be much better placed to adapt to any new demands as and when they occur. For handicap persons, anticipating change and trying to account for it before it happens is almost second nature.
Organization & Patience
As a physically handicap person, there are things that will require more effort to accomplish hence the desire and push to plan and organize more is geared towards ensuring that when the first step is taken then every possible problem has been identified and contingency plans hinted at or at the very least put at an advanced state.
In my life, there are instance in which I detect a certain level of impatience with me with regard to this but the benefits one reaps in the long run as a result of planning and organizing before implementation is whole the slow start or the apparent lack of progress in the initial stages.
The ability to plan and organize leads to an interesting outcome as well in a sense that you are not hurried in whatever you choose to under take since there may be multiple pieces to the same puzzle and each of them will come into play at different times. So you wait for everything to fall into place and plans progress towards and objective.
Related to organization and patience is intolerance towards actions or activities that seemingly waste time and effort. Such intolerance can be well founded since planning and organization will inevitably lead to justifying the task at hand and examining more cost effective avenues of reaching the same goals. The end result of such a process is that whatever effort is put in place is always justifiable and as such would require all possible focus to ensure its success. It is not a perfect process and may not work that well in new situations but the intention is always to look for a chance and opportunity to do it much better and using much less effort to accomplish.
Conclusion
While a disability forces a different view of life out of necessity, the different perspective does have advantages which become both heighten and developed in handicap people. The aforementioned qualities are not certainly limited to handicap people but their lifestyle makes them important qualities to have and practice and as such they have been constantly and regularly fine tuned. Handicap people are human being as well and the aforementioned list may not be applicable to them all and it is entirely possible that some of them are not even aware that they exercise such qualities in their lives.
Programming Paradigms
In the past I enjoyed the concept and practice of programming because it provided an opportunity to explore a way of thinking about a problem without the usual constraints that one may face in the real world. The greater challenge (hence satisfaction) is in defining a model that will account for any potential failures and still be able to accomplish its intended purpose. As time passed, I have come to focused specifically on design and the resulting architecture. Designing anything is a process of creating a model that can account for the solutions to aspects of the problem specified. That is reductive in and of itself but there are much more insightful aspects of problem solving that need to be taken into account in designing and developing a solution.
In any design effort, the ability to abstract from the problem remains imperative while the generally accepted adage of too much of [take-your-pick] is a poison applies, abstraction done right can provide a practical solution to a multitude of problems. Programming paradigms have always been about creating models that either provide a way for us to give instructions to computers or a way for us to describe the world in a manner that a computer can comprehend and hence process. Programming languages remain a way for humans (programmers, software engineers, etc) to interact with a computer – giving it instructions on what to do and how to handle the particulars of our reality. The models that are implicitly encoded into programming languages represent our thinking as far as the machine-like view of the world or bringing the machine closer to the way we appreciate the world.
What are generally referred to as low level programming languages were essentially intended to enable us to communicate with computers and as such they bare close relationship to the way in which computers operate. Think of the assembly language and how you program in it.
With time, additional abstractions were added that allows us to focus more on giving computers instructions as opposed to prescribing the manner in which the computer carries out our instructions. This focus on instructions gave raise to what are generally referred to as procedural programming languages in which the emphasis was on results of the operations that need to be accomplished. The ability to focus on what you want done and how it is achieved in steps, obviously led to a greater interest in using computers to carry out what are essentially repetitive tasks that could easily be encoded in a number of functions which can then be executed and produce the desired result (or report errors, if any).
This focus on the procedures that are needed to accomplish a task leads to a huge codebase that is both hard to maintain and/or evolve to meet new and/or changing circumstances. This great problem would apparently seem to come from the fact that the procedural way of software development, does not adequately account for how the real world operates. In the real world, things exist and operate as a single unit – there is no difference between what something is and what it does.
Personally, I get the impression that this is the time when programming became a bit more philosophical in a sense that there is a deliberate effort to model the world in terms of its nature and its essence. The nature of the world, describes what the world is: in OOP, this is simply described as the state of the an object which is typically denoted by properties/attributes/fields, depending on the terminology of your platform of choice. You may notice that the nature of objects so defined does not need to change in order to make things happen because OOP relies on message passing to get Objects with the appropriate nature to carry out the intention of their essence as defined by their nature (what you do is defined by your nature and your nature defines what you do).
While OOP allows for a better abstraction from the real world, the manner in which it has been implemented thus far has a serious short coming. All the OOP languages that I have come across are rather verbose as the design process need to describe any application elements of the problem space in code. With increasingly large programs, it comes much more challenging to maintain large programs or ensure that they are tested to the satisfaction of end users. So, testing frameworks have mushroomed around OOP languages such as Java with JUnit (among so many others).
For all intends and purposes, OOP still bears some lingering association with how a machine would go about processing instructions. The so-called Fourth Generation Languages (4GL) like the Structured Query Language (SQL) has shown us to go about expressing our intention to the machine and have the machine figure out the means of getting to our intentions or at the very least least as close to it as possible. The oft-referenced Moore’s law continues its march into ever more powerful machines albeit in a slightly different way. With powerful processors, driving our computers we do not have to be chained to the vagaries of machine type thinking.
Another more poignant point to consider is the increased use of computers for entertainment (gaming etc), business and socializing. The nature of the problems that face social networking applications are markedly different from what have faced businesses at the advent and development of the current mainstream programming language. A business environment invariably has some kind of structure around it which is encoded in policies, procedures, organization structure and the processes that the organization run. Starting from such a foundation, it is then possible to formulate a few procedures which can be executed at regular or ad hoc basis to great effect. However, consider the way in which social networking sites are used – a single person would have a Facebook account, a Twitter account, YouTube account in addition to web mail accounts. These applications have become people centric and the number of people involved an quickly become a challenge for social networking sites that have managed to garner a big enough following.
The social network craze reveals an interesting dimension of how programming languages have evolved over time. At the outside, a few academicians used computers to help with research and then the business world caught on and now we have to face the reality that perhaps programming languages need to be less rigid. Often when discussing IT related subjects, less rigid may easily lead to less secure though in this context less rigid but more robust would be the best outcome in the evolution of programming languages. Objects are good as way to model the world but they lack a certain degree of expressiveness in effectively illustrating and modeling the state of the world as a seen a person who cares more about getting things done and less about the steps taken to get to the end.