MVC

31 03 2013
MVC Diagram

Src: Wikipedia

MVC stands for Model View Controller and it’s a modern design pattern used for web applications development.

MVC pattern divides an application in different modules:

  • Model – It’s the application module that communicates with the DB (query, alter and data storage) and contains the business logic.
  • View – Is responsible for the presentation or design.
  • Controller – Maps user actions, connecting view with model: Gets the user input and manages that data, sending it to the correct model and selecting view for response.

Main Advantages:

  • Easy to maintain. The developers can easily make changes.
  • All modules (Model, View and Controller) are independent. This allows different developers to work in the same project without knowing what the other modules do.

It’s been used on the most important Web Frameworks, of different technologies nowadays:
Java Spring, PHP Code Igniter, Ruby On Rails or Python Django (this one uses MTV – Model Template View, which is more or less the same thing with a different name. MTV view corresponds to the MVC controller and the MTV template is the MVC view) and many others.





Cristiano Ronaldo is Facebook star…

29 06 2010

Cristiano Ronaldo, the portuguese football player, is the first athlete achieving more than 5 million Facebook fans!

Congratulations!





IT Private Jokes #4

29 05 2010

FNN – Facebook News Network

Watch other IT Private Jokes, here.





Simple Digital Watch (JavaScript)

29 05 2010

Bellow is a simple JavaScript code to implement a digital watch.

When the page is loaded, the function start_watch() is called and then, Date object is used in conjunction with getHours(), getMinutes() and getSeconds() methods, to keep updating the actual time, per second. To do that, is used the setTimeout function which is calling the start_watch() method every second (or every 1000 milliseconds):

Simple JavaScript digital watch (click on the image to enlarge)





Countdown to save the world (JavaScript)

29 05 2010

There is a simple JavaScript countdown digital clock, below (click on the image to enlarge it). It’s an example of JavaScript code, using time events, which you can easily manage it, to start and stop, using the functions setTimeout and clearTimeout:

Simple JavaScript countdown

Result of the code above

To test it, just copy the code above to your preferred text editor and save it with a .html/.htm extension.





Password Generator (JavaScript example)

25 05 2010

Do you always forget your passwords?
If yes, you shouldn’t :), anyway here is an example to transform a familiar word into a strong password (click on the image to get better resolution):

Password Generator (Javascript+HTML)

The example of code above, was developed using JavaScript and transforms chars into char codes on even chars of the string, as well as the opposite on odd chars.

For instance, from the i4MK string is generated the following password: 104676M

Now when you forget your password, you can use this program, writing your familiar word into the text box.

I hope this can be useful to somebody.

Cheers!





Phishing: Web pirates take advantage from Haiti earthquake…

15 01 2010

Phishing explanation

Another virus alarm!

Symantec alerted about many phishing attacks by hackers using false fundraising for the earthquake victims in Haiti.
Many dangerous mail messages and fake web pages originated this alert from Symantec.

Source: Exame Informática

Nowadays websurfers have to pay attention during their affairs in web…