1 0 Archive | December, 2007
post icon

MVC Architecture

 

MVC Architecture Diagram

Basic Stuff: The Model-View-Controller Architecture has three components used to partition and separate the processing from the display or GUI: The Model, View and Controller.

Basically, the inputs are mapped to the Controller and the outputs are mapped to the View. The Model maintains the persistent state of the Controller. Some MVC Architecture Diagrams show an interface between the View and Model; however, I believe that is incorrect since you want to isolate the view from the content.

For a Web Application, the Controller and View sit on top of TCP/HTTP or HTTPS with the Controller accepting HTTP Request Messages and the View providing the Request Codes and appropriate Markup Language (HTML, XML, etc.) response.

The Model provides the persistent state of the Application and typically interfaces with a Data Base.

Leave a Comment
December 27, 2007
post icon

Not Invented Here — Time to Reframe the Development Process (Part III)

Configuring Cake CSS - default.thtml Leveraging existing technology is always a difficult task. It’s more of a personal challenge to get over the mindset that you can do it better. Perhaps you can, but do you have the time and budget to accomplish the daunting task of building a component that someone already has built for you?

There’s a lot of buts: it’s too slow, it’s not modular, it’s “fill in the blank” … Just get over it. Look for ways to extend the component for your application. Write a wrapper, build an interface, just get it to work.

Configuring CakePHP

I spent some time trying to figure out how to change the default templates. Resulting to grep for a few html tags, I found the “default.thtml” file in the /app/views/layout directory. Apparently I overlooked the obvious, because on the home page of your configuration, it tells you exactly that! Duh.

I copied over CSS, images and updated the default template and started getting that urge of “I can do it better.” I managed to overcome it quick by putting a bunch of “TODOs” in the template. I believe that there are a few ways to configure the helper functions or better yet, extend them to our application.

I still don’t understand the CakePHP architecture and the layers of the cake (pun intended). An architecture diagram would be very helpful at this point in time. This is probably the next thing in the list to do: see if one exists or start drawing one.

Leave a Comment
December 14, 2007
post icon

Not Invented Here — Time to Reframe the Development Process (Part II)

nih-cakephp-config3.jpgNot Invented Here is a continuing series of articles to help you overcome the hurdles of reusing and leverage existing technology for rapid development. The decision to develop any product in-house takes considerable amount of effort and development time. Reusing components and integrating them with your product reduces the time to delivery and in the long run produces a better produce since you can focus on your core strengths.

Our decision to toss out our in-house PHP Framework FIZZI and start from scratch with CakePHP was not taken lightly. The time, effort and development costs are nothing to the future costs of maintaining and upgrading FIZZI. Simply put, let’s get out of the Framework Business and focus on our core process and system strengths!

Installation of CakePHP

No matter how trivial the Cake Developers made the installation process, I simply can’t brush over this step because I’m a dumb ass. I installed CakePHP on a server with an older version of PHP (4.2). After mucking with the initialization script to set up the include paths correctly, CakePHP was bombed out in a session function that was introduced in PHP 4.3.

I know, I should have read the minimal requirements, but what Software Developer really reads yet implements the requirements? So I had to install it on a server with PHP 4.3+ or PHP 5+. That implies either upgrading our in-house test server and possible breaking ongoing development on other projects, use a virtual server on my desktop or just go for broke and install it on a existing domain at a hosted server.

Cake PHP Configuration ChangesAfter the trial and error of installing CakePHP on our test server, installation on the hosted server was a breeze! Three lines of code in the initialization file and three parameters in the database file need changing. Load the home page with success! Ideally, if you had the capability to install cake in /usr/local/src, you should install it there. This will make system-wide upgrades easier in the future especially if you are planning to use CakePHP for more than one project.

Leave a Comment
December 13, 2007
post icon

Not Invented Here — Time to Reframe the Development Process

not-invented-here.jpg“Not Invented Here” (NIH). This is one of the biggest hurdles developers have to overcome when reusing components, modules, functions or snippets in the production software. I’ve run across it my entire development career — developers simply do not like to use software that they don’t write and own — and of course, I’m am guilty as the next developer.

So today I’m starting out with a positive outlook and tossing out our in-house PHP Framework (FIZZI) that we’ve been using for MustFindit and replacing it with CakePHP. It’s taking too long to develop MustFindit and extending and adapting FIZZI for MustFindit’s requirements will basically kill the project.

Why CakePHP? I’ve considered Rails, Symfony and quite a few more; however, CakePHP seems like the best fit with our current technology, design and knowledge base for a MVC architecture. This is a big plus since we want to expedite development process and keep the learning curve down as much as possible.

Over the next few days, I hope to present our findings on CakePHP and if it is a viable Development Framework for PHP and our projects.

Leave a Comment
December 12, 2007
post icon

Life Span of a Mouse

AA BatteriesToday was the first day I had to change the batteries in my Microsoft Natural Mouse. The two Energizer AA batteries that came with the mouse ran out of juice after about four months of use.

The mouse got a new life with some old 1800 mAh rechargeable batteries I found in the garage. (I hope the batteries still hold a charge!)

The Microsoft Natural mouse took about 3 days to get comfortable with due to its ergonomic size and shape but I have less pain in my wrist than I ever had before.

Eventually I ended up getting one at the JOB because the cheap mouse they bundle with computers today basically suck. They have a horrible shape and feel to them. That cold plastic and dove-bar shape is nothing to get excited about.

I expect I’ll be replacing the batteries in the mouse at work next month sometime if the battery life is about the same.

Leave a Comment
December 10, 2007