Page 1 of 14 123411 ... LastLast
Results 1 to 10 of 132
  1. #1
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478

    Default Design Pattern, Implementation Pattern and Best Practices


    Opening this thread for the discussion of best practices in any programming tool.

    Topics may include:
    -- OO design, Design Pattern to use
    -- Implementation patterns and idioms
    -- Performance tuning
    -- Antipatterns/Pitfalls
    -- Data Structure and Algorithm
    -- Frameworks/API/Library - what and why?
    -- Good tools that supports best practices i.e. profiler, UML tools, etc
    -- etc

    Good for knowledge sharing.

  2. #2
    can u give specific examples on what you posted there?

    what kind of design patterns are you talking about? best practices?

    like coding convention? MVC paradigm?

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Quote Originally Posted by bluedes View Post
    can u give specific examples on what you posted there?

    what kind of design patterns are you talking about? best practices?

    like coding convention? MVC paradigm?
    all kinds of patterns you think of depends on your problem. Someone can start by asking a question and someone might suggest what design to use. Or we can do it in reverse, what does the MVC all about, what does it solve, and how to implement?

    Coding convention is a good topic too. Do you have suggestion?

    Which is faster arraylist vs vector?

    What are the common pitfalls in a programmer?

    Sort of a bit advance na topic and not discussiong about language war.

  4. #4
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Ok Ill start....

    Connection Pooling -- is a way of caching the connections that has been created and reuse the cached connections without reopening/reconnecting.

    It is good practice to implement an application with connection pooling to have better performance of client/server commands and operations.

    Opening a connection is a very expensive operation (looking up IP from DNS, authentication, authorization, etc). Instead of closing the connection you can cache the connection and reuse it later.

    It's pretty common to pool a database connection. In Java, there many open source db connection pooling library. One of the most popular is Apache Commons DBCP. Most Javaapplication servers also support pooling.

    Hope this help. Any good question?

  5. #5
    Quote Originally Posted by kamsky View Post
    all kinds of patterns you think of depends on your problem. Someone can start by asking a question and someone might suggest what design to use. Or we can do it in reverse, what does the MVC all about, what does it solve, and how to implement?

    Coding convention is a good topic too. Do you have suggestion?

    Which is faster arraylist vs vector?

    What are the common pitfalls in a programmer?

    Sort of a bit advance na topic and not discussiong about language war.
    i see..

    i have this coding convention that i hope people will use.. it makes for really readable code.. this is for compiled strict-typed language though

    Code:
    return-type
    func-name_(_param-array-list_)
    {
         func-body
    }
    example:

    Code:
    double
    circumference ( double radius )
    {
         return PI * radius * radius;
    }


    and when having if/loop conditions, always try to put the constant in the left side of the comparison operator

    for example:

    if ( response == yes )

    change to

    if ( yes == response )


  6. #6
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Nice. I saw that kind of coding convention too in log4j developers.

    btw, are they tabs or spaces?

    I am following coding standard document in 'Element of Java Style' -- Scott Ambler.

    PS.
    I am going to summarize the Element of Java Style if I have time.

  7. #7
    Quote Originally Posted by kamsky View Post
    Ok Ill start....

    Connection Pooling -- is a way of caching the connections that has been created and reuse the cached connections without reopening/reconnecting.

    It is good practice to implement an application with connection pooling to have better performance of client/server commands and operations.

    Opening a connection is a very expensive operation (looking up IP from DNS, authentication, authorization, etc). Instead of closing the connection you can cache the connection and reuse it later.

    It's pretty common to pool a database connection. In Java, there many open source db connection pooling library. One of the most popular is Apache Commons DBCP. Most Javaapplication servers also support pooling.

    Hope this help. Any good question?
    i think connection pooling is defacto na.. the system does it for you automatically..
    but how do you effectively implement connection pooling in code, i think that would be a good question.. i'm not sure about other languages, but in php-mysql or MSADO, persisting the variable/object that holds the connection effectively handles connection pooling..

    in a quick and dirty fashion, I usually declare a static database connection object and just reference that globally.. but its more complicated than that in reality, especially when ur dealing with (nested) transactions na..

    share pud mo unsa inyo styles dha.. share and share alike..

    Quote Originally Posted by kamsky View Post
    Nice. I saw that kind of coding convention too in log4j developers.

    btw, are they tabs or spaces?

    I am following coding standard document in 'Element of Java Style' -- Scott Ambler.

    PS.
    I am going to summarize the Element of Java Style if I have time.
    tabs bro, i stopped using spaces a long time ago.. bati-an ko sa spaces kay dili xa adaptive if ur codes are being used on other editors.. usually, 1 tab per indent, and i can just set the editor to render 1 tab as 2-3 spaces, depends on the editor.. most editors now can specify the space rendering of tabs..

    would nice to see that Element of Style pud, post nya..

  8. #8
    Singleton, Facade, MVC?

  9. #9
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Quote Originally Posted by eax View Post
    Singleton, Facade, MVC?
    yes bro. if you can share everyone what is Singleton, Facade, and MVC what are they and what problems does they solve that would nice.

  10. #10
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Quote Originally Posted by bluedes View Post
    i think connection pooling is defacto na.. the system does it for you automatically..
    but how do you effectively implement connection pooling in code, i think that would be a good question.. i'm not sure about other languages, but in php-mysql or MSADO, persisting the variable/object that holds the connection effectively handles connection pooling..

    in a quick and dirty fashion, I usually declare a static database connection object and just reference that globally.. but its more complicated than that in reality, especially when ur dealing with (nested) transactions na..

    share pud mo unsa inyo styles dha.. share and share alike..



    tabs bro, i stopped using spaces a long time ago.. bati-an ko sa spaces kay dili xa adaptive if ur codes are being used on other editors.. usually, 1 tab per indent, and i can just set the editor to render 1 tab as 2-3 spaces, depends on the editor.. most editors now can specify the space rendering of tabs..

    would nice to see that Element of Style pud, post nya..
    I think it's reverse. tabs looks uglier in different editor and spaces are consistent. I was a 'space' fan for that reason and but now reverted to 'tab'. element of java style preferred spaces in their first edition but changed to 'tab' in 2nd edition. Using tab is okay as long as you stricly use as 1 unit. then i changed to tab.

    re: Connection Pooling. At least in javaworld, not everything is connection pooled yet.
    But if you are in an application server most likely it's pooled and also some jdbc driver has it's native connection pooling.
    A good practice, let's make sure that this one is considered and enabled if needed.

  11.    Advertisement

Page 1 of 14 123411 ... LastLast

Similar Threads

 
  1. what's the best and most practical NEGOSYO today?????
    By fratbaxxx in forum Business, Finance & Economics Discussions
    Replies: 166
    Last Post: 10-09-2014, 01:31 PM
  2. Looking For: Pattern makers, Seamstresses and Tailors
    By kamikaze_007 in forum Jobs
    Replies: 5
    Last Post: 06-02-2013, 10:47 AM
  3. Replies: 0
    Last Post: 09-14-2007, 10:14 AM
  4. Replies: 0
    Last Post: 06-21-2007, 11:01 AM
  5. Bad design and coding practices (antipatterns)
    By cmontoya in forum Programming
    Replies: 8
    Last Post: 01-05-2006, 06:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top