Tuesday, January 12, 2016

MVC or MOVE : Choice is your's !!

Few month back I build an restful application using ZF 2.4 and come across with its solid functionality called "EventManager". Yesss Event Manager which draw a broader line between Zf1 and new ZF2 Initially I was confused about its importance in my development but moving ahead I understood its real crux. So really ZF2 is MVC or MOVE ?
MVC = Model , View Controller
MOVE = Model Operation View Event
In Zf2 , controller are divided into two parts in MOVE i.e Operation and Event. You might have heard about "Fat Model , Skinny Controller" for doing good programming using MVC framework. Zf2 is answer for it .
How MOVE is different than MVC ?
Let us consider one small scenario in which user is logging using username and password. What would be case in ZF1 and Zf2. ? In ZF1 the action will be passed to model through controller and Model will talk to database to check the authenticity of user then again revert back result to controller which pass to user (views). No central watch for this action but using MOVE you can create your own events let say "loginevent" and control it centrally. So whenever "loginevent" is fired event take care to talk to model and pass result to view. It provide more controls to use this events from anywhere in your application which is not possible using MVC.
I found some similarity between ZF2 + Doctrine and Spring + Hibernate. Though I cannot say ZF2 is following purely based on MOVE but can bet its best framework developed in PHP. Most of concepts of ZF2 are derived from Spring, Ruby on Rails. Zend Framework use the power of scripting language and are getting more famous among developers. Spring is pure MVC framework which use power of POJO, Dependency Injection and many more which are also found in ZF2. Either its annotation or XML configurations in hibernate using spring or annotation or XML configurations in doctrine using zf , everything is possible. Think bigger now !! move to MOVE !!
Choice is your's :)

Monday, May 27, 2013

Protecting Google Docs

I have find some useful information which can be helpful to protect your data in google docs

Wednesday, October 10, 2012

Magento Developer Toolbar extension- Its Amazing

Professional magento developer toolbar with profiling, database queries, handles, event/observer overview, block nesting, requests and caching.

Be Professional, see what happens in the dark

The Mgt Developer Toolbar for magento is very useful for all developers and frontend guys. 
Many professional developers all over the world use this extension to find possible performance bottlenecks. 
You have an overview of the parse time, memory consumption and number of queries executed. 
It also gives you information about the Controller, Module and Action which is responsible for the current request. 
The advantage for frontend guys should also be mentioned, you get a complete overview 
how the blocks are rendered and which templates are used. This makes all block and template changes
 easier than ever before.


More info : http://www.mgt-commerce.com/magento-developer-toolbar.html

Monday, October 8, 2012

Saass.. Fun with CSS :)

Sass makes CSS fun again. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It’s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin. Sass has two syntaxes. The new main syntax (as of Sass 3) is known as “SCSS” (for “Sassy CSS”), and is a superset of CSS3’s syntax. This means that every valid CSS3 stylesheet is valid SCSS as well. SCSS files use the extension .scss. The second, older syntax is known as the indented syntax (or just “Sass”). Inspired by Haml’s terseness, it’s intended for people who prefer conciseness over similarity to CSS. Instead of brackets and semicolons, it uses the indentation of lines to specify blocks. Although no longer the primary syntax, the indented syntax will continue to be supported. Files in the indented syntax use the extension .sass. Reference : - http://sass-lang.com/

Saturday, March 24, 2012

Cakephp With Facebook HipHop

A new revolution in the world of web development in PHP. You can now compile the code in C++ using the Facebook Hip Hop Compiler.

You can find more details at :-

Running CakePHP using the Facebook's HipHop compiler

Friday, September 16, 2011

Rails : Sweepers

The sweeper is a new mechanism inducted in rails which allows you to get around having a ton of expire_{page,action,fragment} calls in your code.It does this by moving all the work required to expire cached content into an ActionController::Caching::Sweeper subclass. This class is an observer and looks for changes to an object via callbacks, and when a change occurs it expires the caches associated with that object in an around or after filter.

Continuing with our Product controller example, we could rewrite it with a sweeper like this:

class ProductSweeper < ActionController::Caching::Sweeper observe Product # it keep watch on the Product Model # As soon as sweeper detects that any new Product was created call this def after_create(product) expire_cache_for(product) end # As soon as sweeper detects that a Product was updated call this def after_update(product) expire_cache_for(product) end # As soon as sweeper detects that a Product was deleted call this def after_destroy(product) expire_cache_for(product) end private def expire_cache_for(product) # Expire the index page now that we added a new product expire_page(:controller => 'products', :action => 'index')

# Expire a fragment
expire_fragment('all_available_products')
end
end

You may notice that the actual product gets passed to the sweeper, so if we were caching the edit action for each product, we could add an expire method which specifies the page we want to expire:

expire_action(:controller => 'products', :action => 'edit', :id => product)
Then we add it to our controller to tell it to call the sweeper when certain actions are called. So, if we wanted to expire the cached content for the list and edit actions when the create action was called, we could do the following:

class ProductsController < ActionController

before_filter :authenticate
caches_action :index
cache_sweeper :product_sweeper

def index
@products = Product.all
end

end

So just get rid of unnecessary caching and refresh the caching using sweepers mechanism.

ijab with ijabber under the hood of Openfire

What a fantastics chatting solution !!! Its works unimaginable. yes, its the webclient ijab (http://ijab.im) which works fantastics with jabber. No other chat can beat this solution. You can install the ijabber using openfire which provide the complete solution for managing all attributes and actions related to chat.

Both are opensource and available without any cost and very easy to install on the server.

References to both opensources:

(1)http://www.igniterealtime.org/projects/openfire/

(2)http://code.google.com/p/ijab/


Have a happy and fast chatting :)