Friday, December 14, 2012

About Development Frameworks

Knowing a programming language, and problem solving techniques is not enough to develop applications easily and quickly. To illustrate the idea let's assume that you want to develop a windows application. Windows works by passing different messages to different applications. For example when you move the mouse over a window, Windows will create a message that contains information about mouse x,y coordinates and send it to your application. Maybe another window is moving above yours, so another type of message is generated and sent to your application telling it redraw the window and so on.

Now why am i telling you this? Because if you want to do everything yourself you must create a function that listens to the messages that Windows generate, you must process every type of message that is sent to your application, and in some cases reply to. You must take care of redrawing the window itself, and so on. As you can see all of this has nothing to do with the problem you are trying to solve, for example creating a calculator app. All of the previous things I mentioned has to do with how your application interacts with the operating system and its messages. Obviously if you try to do this you will spend alot of time taking care of every little detail, which is : not easy, and time consuming.

The solution to this is using a Development Framework. A framework is like an application that is almost complete. All you need to do is plug in your code into it. This is a simplification of course. Frameworks are much more complicated than that. Going back to our Windows Application example, if you use VB.NET, you never see any thing about operating system messages, repainting the window, etc. It is all taken care of by the framework. You can see that there is a designer where you specify how the window looks, add buttons, and you can view the events. In addition you can access each button through a class. There is actually a class for each control such as buttons, lists, checkboxes, forms, dialogs, etc. Such classes are not part of the language at all. They are part of the framework that allows you to develop windows applications, and they hide all the complicated details from you allowing the developer to focus on the problem itself.

You could find many types of frameworks for a given language. Windows Forms in VB.NET is one simple example. Another one is WPF. It is another framework that allows you to develop windows applications using the same language. For web you have ASP.NET web forms, and MVC. All of these are frameworks for developing different types of applications. You have the same language syntax, but you use different libraries.

For Java you have: Swing for windows applications. You can use Struts - which I don't think anyone is using now - or JSF to develop web apps. You can also use Java to develop Android apps. Again in all these cases the language is the same (JAVA) but the libraries are different.

So why should a programmer knows about this? Well in the end a programmer is required to develop applications. Frameworks helps you developing them to a specific type of platform, or environment. If you don't know how to use a framework you won't be able to develop an application even if you know the language and understand how to solve problems.

Some might ask what kind of framework to learn? Well it depends on what kind of apps you want to develop. Interested in web development? You could choose PHP, ASP.NET web forms, MVC , JSF, etc. Interested in Mobile development? You could learn Android development, iPhone app development, J2ME, etc. Interested in Windows App Development? Choose from Swing, or Windows Forms, WPF, etc. There are lots of options for you. You might want to search the web and ask about the advantages and features of each framework before you choose to learn it.

Hope you find this useful.

Good luck learning a new framework. :)


1 comment:

  1. Hi sir. Sorry if this comment is not about the topic above cause i really need a hand here. I watched your tutorial in youtube about database and textboxes and it's great but i have one question.If I click the save button why can't i see the changes in my database?Please answer I really need your help.Thanks a lot sir!