Mar 18

Video - tutorials are in addition to a textbook is a good introduction to a topic. By SpringSource there on Grails two interesting tutorials on youtube .
If you are interested in the web framework Grails, you should take you half an hour for these two well-made video tutorials.

via:
New video tutorial on Grails - it-republik.de

gklinkmann written by \ \ tags: , , ,

Oct 12

When a design pattern has been proven in web development, then there is the Model-View-Controller pattern or just MVC. I have long been looking for a PHP framework that implements MVC consistently shoots but not the same as using a sledgehammer to crack a nut. Fleet Footed (or "New German" lightweight) object-oriented and it should be. PHP Fame Works such as Zend, CakePHP and Symphony are as likely to race cars. Although they set perfectly to MVC, object-oriented they are, but light-footed is different.

So I'm on CodeIgniter encountered, what is claimed by a "narrow base" (small footprint) to come along.

The installation is ever easy. The ZIP in "DocumentRoot" Unpacking the Web server, rename the directory and the full URL for the website in the configuration file system/application/config/config.php specify.

  'base_url' ] = "http://localhost/allMedia/" ; $ Config ['base_url'] = "http://localhost/allMedia/"; 

And you can already write his first one.

  Controller { extends Controller {class books
    ...  some logic ...

    / / Build view
    load -> view ( 'common/header' , $headerdata ) ; $ This -> load -> view ('common / header', $ header data);
    load -> view ( 'book/list' , $data ) ; $ This -> load -> view ('book / list', $ data);
    load -> view ( 'common/menu' , $menudata ) ; $ This -> load -> view ('common / menu', $ menudata);
    load -> view ( 'common/footer' ) ; $ This -> load -> view ('common / footer');
 } 

CodeIgniter is able to assemble parts of a view before shipping. Templates are supported but not required.

For me, this framework brings everything to what I need:

  • the MVC design pattern
  • consistent object-oriented
  • Performance
  • nice URL's
  • Helper classes (eg for paging)
  • good integration of doctrine as an OR Mapper
  • not to mention a good documentation

"The fire is kindled in me" and implemented a small project already with CodeIgniter. So if Zend and Co. are too complex, should take a look at CodeIgniter a little more closely. It's worth it.

gklinkmann written by \ \ tags: , ,

May 05
Jax 2010 logo

If I would have to build a Java web application at the moment, I would probably connected with the Spring Framework to implement. As part of Jax 2010 , Juergen Hoeller (one of the chief developers of Spring) a review, an inventory and an outlook given on Spring.

After Springsteen has played as many other frameworks and alternative technologies (such as SWT and GWT), in his view, especially in the role as a platform and standards, "enablers" a big role. , Ie frameworks that are more innovative and higher release cycles have as standards such as JPA. Rather, they offer even the possibility of new standards to integrate into existing environments.

So it is possible to work with Spring 3.0 applications using standards such as JSF 2.0 and JPA 2.0, or still on older JBoss, Websphere or Tomcat can even run installations.

This integrative role is, according to Juergen Hoeller continue to determine the path of Spring. Here for June / July 2010, version 3.1 and version 3.2 in 2011 also are provided. This will be like in the past by Milestone releases always kept close to the latest versions of the standards or are they even a small step forward.

gklinkmann written by \ \ tags: , ,

Mar 22

I've used a couple of hours to my hosted on Google Code project grum on the state of things to bring (it was indeed about time). Grum is a small Grails application for user management, enabling me to the web framework Grails 'to "play.

I'm aware of in implementing the many Grails plugins omitted in order to have as few side effects as possible and keep it for those simply looking for an introduction to Grails. So are contained in Grum solutions, such as you:

  • access to a MySQL database implemented
  • 1:1, 1: n and n: m GORM modeled relationships
  • write your own tag libs
  • The JSP Tag Library DisplayTag used the data page by page, to group, sort, and in all possible formats (excel, csv, xml, pdf) to export
  • allows you to upload files
  • functional tests with the webtest plugin uses
  • and the delivery of XML based on specific URL's (short content negotiation) implements

The new version 0.3 now uses grails 1.2.1 and the plugin webtest in version 2.0.3. The source , the SQL files to create the MySQL database and a web archive has all the necessary libraries on Google Code to download ready.

Nutztungshinweise:
The code can be freely used, but may contain errors for which I assume no liability. The license conditions of the libraries it must be observed.

gklinkmann written by \ \ tags: , , , ,

Oct 19
Series:


Part 1 - Pear

While I was in the first part in my little series on HTTP clients have employed with Pear, I will now in the 2nd Part of my attention on the Zend Framework addressed.

Here, too, need 2 packages to complete the task (see Part 1 ). The package Zend_Http is like the Pear package Http_Request2 to pure HTTP communication suitable.
With Zend_Dom can disassemble the received HTML.

One way to solve the task might be:

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
  <Php
 ; require_once 'Zend / Http / Client.php';
 ; require_once 'Zend / Http / response.php';
 ; require_once 'Zend / Dom / query.php';

 'http://www.google.de' ; $ Url = 'http://www.google.de';

 new Zend_Http_Client ( $url , array ( $ Client = new Zend_Http_Client ($ url, array (
     0 , 'Maxredirects' => 0,
     30 ) ) ; 'Timeout' => 30));

 try {
    $client -> request ( 'GET' ) ; $ Response = $ client -> request ('GET');

    200 == $response -> getStatus ( ) ) { if ($ response == 200 -> getStatus ()) {

       new Zend_Dom_Query ( $response -> getBody ( ) ) ; $ Dom = new Zend_Dom_Query ($ response -> getBody ());
       $dom -> query ( 'form' ) ; $ Forms = $ dom -> query ('form');

       $forms -> current ( ) ; $ Form = $ forms -> current ();
       $form -> getAttribute ( 'action' ) ; $ Action = $ this -> getAttribute ('action');

       new Zend_Http_Client ( $url . $action , array ( $ Client = new Zend_Http_Client ($ url. $ Action, array (
           0 , 'Maxredirects' => 0,
           30 ) ) ; 'Timeout' => 30));
       setParameterGet ( 'q' , 'http client examples' ) ; $ Client -> setParameterGet ('q', 'http client examples');
       $client -> request ( 'GET' ) ; $ Response = $ client -> request ('GET');

       new Zend_Dom_Query ( $response -> getBody ( ) ) ; $ Dom = new Zend_Dom_Query ($ response -> getBody ());

       $dom -> query ( 'a.l' ) as $link ) { foreach ($ dom -> query ('a.l') as $ link) {
          $link -> hasAttribute ( 'href' ) ) { if ($ link -> hasAttribute ('href')) {
             $link -> getAttribute ( 'href' ) ; $ Href = $ link -> getAttribute ('href');
             $link -> textContent ; $ Link = $ link text - text content>;

             $href \" > $linkText </a><br />" ; echo "<a href= \" $href \"> $ link text </ a> <br />";
          } 
       }

    { Else {}
         . $response -> getStatus ( ) . ' echo "Unexpected HTTP status: '$ response -> getStatus ()'..  '.
              responseCodeAsText ( ) ; $ Response -> responseCodeAsText ();
     }
 Zend_Http_Exception $e ) { } Catch (Zend_Http_Exception $ e) {
     . $e -> getMessage ( ) ; echo 'Error:' $ e -> getMessage ().
 }
 ?> 

The code speaks for itself, so I will not explain it at this point as much detail as in the first part.
The difference is in the parsing of HTML's. The query () method (lines 18 and 31) provides that is not an array, but rather an object of class Zend_Dom_Query_Result back. Because this class, the two interface Countable and Iterator implemented, the results of the inquiry with a foreach loop to go through. Every single match is an object of class DOMElement shown.

Conclusion:
Zend also offers a good Zend_Dom Zend_Http and HTTP client. If you use other classes already in his project from the Zend Framework, this approach is recommended.

Outlook:
In Part 3 I leave the PHP world and imagine with HttpUnit a very comfortable and feature-rich HTTP client for Java.

gklinkmann written by \ \ tags: , ,