Thursday, October 21, 2010

My experience with Adwords profit sharing

This is what I got from G Adwords for putting adds on this blog.

Page impr    Clicks      Page CTR        eCPM ?            Earnings

3119             11            0.35%                0.89                       $2.79


And this is what one of my client paid for promoting his business via adwords.

Page impr    Clicks      Page CTR      eCPM ?           Costs
 3537                  20            0.57%                                         $99.83                    


Lol Apple's 70/30 is a better deal.




Anyways I'm gonna take out Adwords from this blog.



"Trust is that there should be no difference between what you do and say and what you think." - Umar






Thursday, October 14, 2010

Why its not easy to find Good Java Developers.

Recently I came across lots of post trying to unlock why its difficult to find good Java Developers so I wanted to share my view on this topic. I've been training people on Java since 2007 for various consulting companies.

First lets consider the time it takes to become an expert in PHP Development. A good php developer is expected to know these technologies (PHP, HTML, CSS, Javascript, SQL, Photoshop), and in 1 month of training he can start coding in php and in an year he will have nice grip over all these technologies. So a guy with 1yr of experience is good enough to be considered for most of the php jobs.


 Now lets consider what it takes to become a good Java developer, most of the posts on job portals will look like this Java, SQL, ORM, MVC, HTML, Unit testing, Servlets, JSP, JDBC, AJAX, Design Patterns, Web Services, and IOC.

Most of the students coming straight out of the college know quite a bit of Java, They write desktop and web application using very less standard technologies, for instance.
   1. Desktop application is written using Java, Swing, JDBC, MySQL, most students don't even use JUnit, ORM or any design patterns
   2. Web Applications are written similar way using Java, Servlets, JSP. so hardly they use any standard practices, there is no SVN, Testing, MVC, AJAX, CSS, ORM or Design Patterns.

lets see how much time it needs to learn these technologies which employers expect in a good Java Developer.
Java - remember Java itself is a rich technology and it needs quite some time to master this it.
MVC framework - Spring, Struts, or JSF
JUnit
CSS
ORM - JPA Hibernate, JDBC
Design Patterns - familiarity with application architecture, tiers and layers
AJAX - HTML, CSS, JQuery or similar
Web Services - XML, SOAP, REST etc
SQL - SQL and Oracle knowledge
Spring  - IOC, Transactions
Servers and Build tools


The list for Java is quite a bit lengthy and you expect Java developer to just not know any framework but also know quite a bit of details, best practices and real time work experience. Its clear that we expect more from Java developer. So employers need to do two things either be more competent to attract best with atleast 3 yrs of experience or invest on a fresher.


--

"A belief is not merely an idea the mind possesses; it is an idea that possesses the mind." -- Robert Bolton

Wednesday, October 13, 2010

Its Employers who need to be competent to find good Java Developers

Recently I came across lots of post trying to unlock why its difficult to find good Java Developers so I wanted to share my view on this topic. I've been training people on Java since 2007 for various consulting companies.

First lets consider the time it takes to become an expert in PHP Development. A good php developer is expected to know these technologies (PHP, HTML, CSS, Javascript, SQL, Photoshop), and in 1 month of training he can start coding in php and in an year he will have nice grip over all these technologies. So a guy with 1yr of experience is good enough to be considered for most of the php jobs.


 Now lets consider what it takes to become a good Java developer, most of the posts on job portals will look like this Java, SQL, ORM, MVC, HTML, Unit testing, Servlets, JSP, JDBC, AJAX, Design Patterns, Web Services, and IOC.

Most of the students coming straight out of the college know quite a bit of Java, They write desktop and web application using very less standard technologies, for instance.
   1. Desktop application is written using Java, Swing, JDBC, MySQL, most students don't even use JUnit, ORM or any design patterns
   2. Web Applications are written similar way using Java, Servlets, JSP. so hardly they use any standard practices, there is no SVN, Testing, MVC, AJAX, CSS, ORM or Design Patterns.

lets see how much time it needs to learn these technologies which employers expect in a good Java Developer.
Java - remember Java itself is a rich technology and it needs quite some time to master this it.
MVC framework - Spring, Struts, or JSF
JUnit
CSS
ORM - JPA Hibernate, JDBC
Design Patterns - familiarity with application architecture, tiers and layers
AJAX - HTML, CSS, JQuery or similar
Web Services - XML, SOAP, REST etc
SQL - SQL and Oracle knowledge
Spring  - IOC, Transactions
Servers and Build tools


The list for Java is quite a bit lengthy and you expect Java developer to just not know any framework but also know quite a bit of details, best practices and real time work experience. Its clear that we expect more from Java developer. So employers need to do two things either be more competent to attract best with atleast 3 yrs of experience or invest on a fresher.

Tuesday, October 5, 2010

Reuse JPA Entities as DTO

Note : Major design advantages of JPA Entities are they can detached and used across tiers and networks and later can by merged.

Checkout this new way of querying entities in JPA 2.0


String ql = "SELECT new prepclass2.Employee (e.firstname, e.lastname) FROM Employee e";
List<Employee> dtos = em.createQuery(ql).getResultList();

The above query loads all Employee entities but with subset of data i.e. firstname, lastname.

Employee entity looks like this.

@Entity
@Table(name="emp")
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Column
    private String firstname;
    @Column
    private String lastname;
    @Column
    private String username;
    @Column
    private String street;
    @Column
    private String city;
    @Column
    private String state;
    @Column
    private String zipcode;
    @Column
    private String country;

    public Employee(){}
    public Employee(String firstname, String lastname){..}
    .
    .
}


Benefits of the above approach

  1. No separate DTO classes are required
  2. Re-Use same Entities for exchanging data in any combinations
  3. You can also create DTO classes and load data but why would you wanna do that when we can reuse entity classes
  4. No need to write converters (i.e. DTO-Assembler) for copying data from entities to dtos and vise-versa
  5. Performance efficient

Sample Load Test Results for loading 50K Employee entities using Hibernate JPA.


  General Way          -->  4621 ms
  Constructor Query -->   309 ms





Contructor Expression Rules
  1. Entity or non-Entity class can be used to load coarse-grained data
  2. Class should have a matching constructor defined with correct argument types
Also you can use Constructor queries with non-entity classes for instance

String ql = "SELECT new prepclass2.EmployeeDto (e.firstname, e.lastname) FROM Employee e";


    I encourage you to write your own test cases to validate performance gains. though I'm more than convince this is a nice way of sharing required data between tiers in a more performance efficient and simple way without introducing more dto classes to digest.