Programming Style
Design Patterns +
Library +
Community =
Framework
Introduction
Conceptions
You can not be an individualist
Code Style
● camelCase
    getName, setName, init, ....

● PascalCase (UpperCamelCase)
    GetName, SetName, Init, ....

● Hungarian Notation
    bBusy, chInitial, fnFunction, ...
Design Patterns
Golden Rules
DRY



In software engineering, Don't Repeat
Yourself (DRY) or Duplication is Evil (DIE) is a
principle of software development
DRY (Programmers Story #1)
Hi.

I am Tom. I am writing my backend with PHP
and frontend with html5 and JS. Now I am
writing forms of my web shop. I am writing
frontend validator with js and backend
validation with php....

//Say no to Tom
KISS




KISS is an acronym for the design principle
"Keep it simple, Stupid!".
KISS (fuck logic #1)

#define true false

if(true==false){
   cout<<"OK";
}else{
   cout<<"NO";
}
KISS (fuck logic #2)

try {
    return true;
} finally {
    return false;
}

//Return??
KISS (fuck logic #3)
<?php

var_dump(NULL < -50); // TRUE
var_dump(NULL < 0); // FALSE

var_dump(FALSE < TRUE); // TRUE
var_dump(FALSE < FALSE); // FALSE
Design Patterns
OOP
SOLID
The principles when applied together intends
to make it more likely that a programmer will
create a system that is easy to maintain and
extend over time.

PS. SOLID (Single responsibility, Open-closed,
Liskov substitution, Interface segregation and
Dependency inversion) - WTF Name??
SRP (Single responsibility principle)
class RestaurantAndFirstShopOnTheLeft {
   //Restaurant
   int waiter_age;
   char[] waiter_name;
   float pizzaCost;

    //Shop
    float itemsCost;
}
OCP (Open/closed principle)
“software entities … should be open for
extension, but closed for modification”.

final class HashMap{...} //??
final class ArrayList{...} //??

final public getItem(...){...} //??
LSP (Liskov substitution principle)

“objects in a program should be replaceable
with instances of their subtypes without
altering the correctness of that program”


Object o = new ArrayList();
ISP (Interface segregation principle)

“many client-specific interfaces are better
than one general-purpose interface.”

class Restaurant : Building {
   //...
}
DIP (Dependency inversion principle)

@Stateless
class Users{

    @PersistenceContext
    private EntityManager entityManager;

    //...
}
Design Patterns
Application
MVC



Model–view–controller (MVC) is a software
architecture pattern which separates the
representation of information from the user's
interaction with it.
MVC Example: ZendFramework
MVP (First View)



Model–view–presenter (MVP) is a derivative of
the model–view–controller (MVC) software
pattern, also used mostly for building user
interfaces.
MVP Example - Java Server Face
MVP - form


<h:form>
 <h:outputText value="Enter your name: " /></td>
 <h:inputText value="#{StoreNameBean.personName}" />
 <h:commandButton action="result" value="Say Hello" />
</h:form>
Library
Overview
Library



A collection of standard programs and
subroutines that are stored and available for
immediate use.
Library - Examples:



●   C++ (Standard Template Library)
●   OGRE
●   jQuery
●   Allegro

and many more...
Library Or Framework



But my ankle use ZendFramework
as Library...

Do you think Java Platform API is a library??
Community
support
WP7 & Google Map
Adobe - Phonegap group: https://groups.
google.com/forum/?hl=en%3Fhl%
3Den&fromgroups=#!
topic/phonegap/WVb3nvP0WVA

Google - Community:
https://plus.google.
com/110612117605767826163/posts/6J7CF2Z4
3A1
Google Search Engine & Dynamic
Content

GDG Dublin Group:
https://groups.google.com/forum/?
fromgroups=#!topic/gdg-dublin/KfmwVgbRY68

+ Private Messages
Thank you for attending
sebastian@pozoga.eu
events.pozoga.eu
LinkedIn
Sources
● http://www.thefreedictionary.
  com/program+library
● http://en.wikibooks.org
● http://en.wikipedia.
  org/wiki/Software_design_pattern
● Clean Code: A Handbook of Agile Software
  Craftsmanship
● The Pragmatic Programmer: From
  Journeyman to Master

Programming style

  • 1.
    Programming Style Design Patterns+ Library + Community = Framework
  • 2.
  • 3.
    You can notbe an individualist
  • 4.
    Code Style ● camelCase getName, setName, init, .... ● PascalCase (UpperCamelCase) GetName, SetName, Init, .... ● Hungarian Notation bBusy, chInitial, fnFunction, ...
  • 5.
  • 6.
    DRY In software engineering,Don't Repeat Yourself (DRY) or Duplication is Evil (DIE) is a principle of software development
  • 7.
    DRY (Programmers Story#1) Hi. I am Tom. I am writing my backend with PHP and frontend with html5 and JS. Now I am writing forms of my web shop. I am writing frontend validator with js and backend validation with php.... //Say no to Tom
  • 8.
    KISS KISS is anacronym for the design principle "Keep it simple, Stupid!".
  • 9.
    KISS (fuck logic#1) #define true false if(true==false){ cout<<"OK"; }else{ cout<<"NO"; }
  • 10.
    KISS (fuck logic#2) try { return true; } finally { return false; } //Return??
  • 11.
    KISS (fuck logic#3) <?php var_dump(NULL < -50); // TRUE var_dump(NULL < 0); // FALSE var_dump(FALSE < TRUE); // TRUE var_dump(FALSE < FALSE); // FALSE
  • 12.
  • 13.
    SOLID The principles whenapplied together intends to make it more likely that a programmer will create a system that is easy to maintain and extend over time. PS. SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) - WTF Name??
  • 14.
    SRP (Single responsibilityprinciple) class RestaurantAndFirstShopOnTheLeft { //Restaurant int waiter_age; char[] waiter_name; float pizzaCost; //Shop float itemsCost; }
  • 15.
    OCP (Open/closed principle) “softwareentities … should be open for extension, but closed for modification”. final class HashMap{...} //?? final class ArrayList{...} //?? final public getItem(...){...} //??
  • 16.
    LSP (Liskov substitutionprinciple) “objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program” Object o = new ArrayList();
  • 17.
    ISP (Interface segregationprinciple) “many client-specific interfaces are better than one general-purpose interface.” class Restaurant : Building { //... }
  • 18.
    DIP (Dependency inversionprinciple) @Stateless class Users{ @PersistenceContext private EntityManager entityManager; //... }
  • 19.
  • 20.
    MVC Model–view–controller (MVC) isa software architecture pattern which separates the representation of information from the user's interaction with it.
  • 21.
  • 22.
    MVP (First View) Model–view–presenter(MVP) is a derivative of the model–view–controller (MVC) software pattern, also used mostly for building user interfaces.
  • 23.
    MVP Example -Java Server Face
  • 24.
    MVP - form <h:form> <h:outputText value="Enter your name: " /></td> <h:inputText value="#{StoreNameBean.personName}" /> <h:commandButton action="result" value="Say Hello" /> </h:form>
  • 25.
  • 26.
    Library A collection ofstandard programs and subroutines that are stored and available for immediate use.
  • 27.
    Library - Examples: ● C++ (Standard Template Library) ● OGRE ● jQuery ● Allegro and many more...
  • 28.
    Library Or Framework Butmy ankle use ZendFramework as Library... Do you think Java Platform API is a library??
  • 29.
  • 30.
    WP7 & GoogleMap Adobe - Phonegap group: https://groups. google.com/forum/?hl=en%3Fhl% 3Den&fromgroups=#! topic/phonegap/WVb3nvP0WVA Google - Community: https://plus.google. com/110612117605767826163/posts/6J7CF2Z4 3A1
  • 31.
    Google Search Engine& Dynamic Content GDG Dublin Group: https://groups.google.com/forum/? fromgroups=#!topic/gdg-dublin/KfmwVgbRY68 + Private Messages
  • 32.
    Thank you forattending sebastian@pozoga.eu events.pozoga.eu LinkedIn
  • 33.
    Sources ● http://www.thefreedictionary. com/program+library ● http://en.wikibooks.org ● http://en.wikipedia. org/wiki/Software_design_pattern ● Clean Code: A Handbook of Agile Software Craftsmanship ● The Pragmatic Programmer: From Journeyman to Master