moving to my notebook :)

Yesterday I got my notebook and today I am busy with it:)
or let’s say enjoying it:)

nice notebook pretty notebook I’ll format you delete all files, I’ll setup lot of project nice notebook pretty notebook

And As you can guess I will be whole week event :)

what I have done up to now

jdk 6u2
idea 6.0.6
maven 2.0.7
postgres 8.2
tortoisesvn
firefox

and checkout my projects to test the performance :)

anti-JSF thoughts

more random patterns in the morning 'spresso

Image by Brian Daniel Eisenberg via Flickr

before I begin I should say, I tried JSF several times but all off them is bad.

Why?

Easy Navigation (!): Why do a framework disables back button and uses non-sense URLs? you cannot bookmark a single page, do not even try to read the URL it all sucks.

Always POST: why ? all non-sense and more no redirect after any post ?
nice article http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost

Restore View: Although it is in default life-cycle it would be %90 unnecessary and for any given insert page you will feed several combobox’s chechbox why ?

Complex Component Development: Although it is a component oriented framework it is harder to develop a component then a JSPTag.

Disable custom jsp tags all should be JSF oriented why ?

For All these choose any Action oriented framework: like struts,spring mvc,

more thoughts:

http://timshadel.com/blog/2006/01/19/jsf-the-7-layer-burrito-i-wont-eat-again/
http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost

Reblog this post [with Zemanta]

‘Too many open files’ but what are they?

java.io.FileNotFoundException: /opt/tb55/s3/conf/web.xml (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106)

this shows the open file limit has been reached.. you can check this by JMX
java.lang:type=OperatingSystem >  OpenFileDescriptorCount
but what are these files ? you can see this by linux shell script

lsof -u tomcat

lsof manual

solution: increase systems open file limit !!!

vi /etc/security/limits.conf

and edit the line to increase open file limit

* soft nofile 3072
* hard nofile 4048

Reblog this post [with Zemanta]

when do not generate code !

Cloud Factory

Image by saharsh via Flickr

Currently code generation is very common way of some handling common repeating code fragments and some initial setup task like startup configurations and so on. Some clear benefits are:

  • ease your setup process
  • protects your code form some common coding mistakes
  • maintain some coding pattern practices and standards.
  • keep your effort on complex tasks

    But on the other hand when you evaluate code generator or while writing your code should thing about ” why you generate this code ? and not writing some generic component to evolute such business
    this is the most common mistake while using this technology. you generate code to customize the generated code. If you not need this fragment to customization. DO NOT GENERATE IT. otherwise in most case any enhancement in these fragments will require great effort or worse (to generate again).

    so what is important.

    • more less code generated more perfect it is
    • more easily you customize it more useful it is

    Some code generators:
    http://www.codegeneration.net/

    Who are you building for?

    worth to look for :)

    video

    Reblog this post [with Zemanta]

    URI Encoding for tomcat 5.5.X

    Apache Tomcat

    Image via Wikipedia

    encoding problem with paramater while HTTP GET ?
    in default tomcat read get parameters with its startup language like = ISO-8859-1

    for tomcat 5.5.x

    <Server ...>
    <Service ...>
    <Connector ... URIEncoding="UTF-8" />&nbsp; ...&nbsp; </Connector>
    </Service>
    </Server>
    
    Reblog this post [with Zemanta]

    moved to postgres

    PostgreSQL

    Image via Wikipedia

    I change my development database to postgres SQL for a several reasons :

    • I’am bored to mysql :)
    • mysql do not give me entreprise database trust: looks so simple even too simple to offer to my customers. it suites for less complicated fast application.
    • Last but most important reason it its Licensing !!!

    Since I am very new to postgres I am playing with it. looking for new features and trying to solve compatibility problems :(

    One good referance for people like me :

    Converting mysql to Pstgresql

    PS:
    since I am using hibernate and so on no development required for this migration…

    Reblog this post [with Zemanta]

    OSWorkflow as Object State Machine

    A graph of an extremely basic process in a fin...

    Image via Wikipedia

    OSWorkflow is a very simple and flexible workflow engine. Developers including me really like its simplicity. One can write very simple XML’s for steps, actions, conditions and functions; and it is done. OSWorkflow can be easily integrated with very common frameworks like spring,acegi,hibernate.intergation project

    What is next? In my simple example project you can see at least one persistent object with an attribute like status. With or without any workflow engine this property shows the step of that object.

    public interface WorkFlowCoreService {
    /** simply put className,objectID,url,property to propertySet */
    long startWorkflow(int initialAction, String className, Long objectID, String property);
    
    /**To the action in workflow and set property to new value for the object*/
    void doAction(long workFlowId, int actionId) throws WorkflowException;
    
    }
    
    • Draft
    • Send to approval
    • Accepted
    • Rejected

    But let’s use this property only for the read out of WF engine. and only change its value when its step is changed by the engine.

    What you will get ?

    Simplicity: Since the state changes are done as workflow state changes, it will be clearer and simpler.

    Workflow Engine: As your projects are getting close to end, you can expect approval and states with more frequent changes and additions. If you use a workflow engine it will be more manageable.

    Abstraction: Your state change business (send mail to him, increase those values) will be more hidden from any other mechanisms.

    Ref:

    http://opensymphony.com/osworkflow

    https://springmodules.dev.java.net/

    http://today.java.net/pub/a/today/2006/01/04/business-processes-with-osworkflow.html?page=last&x-order=date&x-maxdepth=0

    Reblog this post [with Zemanta]