Pages

Translate

Friday, 25 January 2013

poncho`s are not only for mexicans

                                               

                           
                Poncho`s are not only for mexicans

What is the first thing you think about when you hear...poncho???? mexicans??? sombrero? and southamerica???


if you had this kind of picture in your mind then i think its time that you know that there are alot of more than just this kind of ponchos:




Ponchos can be really fashionable and really stylish :) you dont believe me then take a look at this :


a cute poncho with a adorable bunny pouch  <3
where to buy ---> http://www.irregularchoice.com/shop/search/product/4024/pac-a-poncho.html?offset=1




This Poncho i saw at the yumetenbo onlineshop =) it seem really warm and gives me a cute (i love the big ribbon) but also a kinda elegant feeling when i look at it :)
where to buy--> http://global.rakuten.com/en/store/dreamv/item/510710/ (sadly it is sold out at the moment)


another poncho from yumetenbo ( yap i love this kind of clothes xD) This time its an bear ear hoodie poncho *o*
where to buy ---> http://global.rakuten.com/en/store/dreamv/item/510709/


This poncho is from H&M and i own this one by myself :D Its really cute and warm and fluffy *_* 

where to buy-----> they dont sell it in the h&m shops anymore...i bought mine on ebay :) so you also should take a look if someone sell it their :) i got mine for 5 euro there *yay*

 I hope you liked it again <3 and changed your mind about ponchos :)




Thursday, 24 January 2013

Tutorial 5 : Using an Object Interfaces


-->
saved as testing.php

<?php
//Define an interface that will allow conversion of objecs to strings
interface conversionOptions{
public function asString();
public function asHTML();
}
//Define a 'cat' class that implements the interface
class cat implements conversionOptions{
//Properties of a cat
public $name;
public $color;
//Constructor that requires a name
public function __construct($namesake){
$this->name=$namesake;
}
//implement the strung function of the interface
public function asString(){
return "Cat - Name:{$this->name},Color:{$this->color}";
}
//implement the HTML function of the interface
public function asHTML(){
return "<ul><li>Cat</li><ul><li>Name:{$this->name}</li>
<li>Color:{$this->color}</li></ul></ul>";
}
}
//Define class that implements the interface,for acronym definitions
class acronym implements conversionOptions{
//Properties of an acronym
private $name;
private $definition;
//Constructor that requires the term entry and definition
public function __construct($entry,$def){
$this->name=$entry;
$this->definition=$def;
}
//Implement the string function of the interface
public function asString(){
return "{$this->name}:{$this->definition}";
}
//Implementthe HTML function of the interface
public function asHTML(){
return "<dl><dt>{$this->name}</dt><dd>{$this->definition}</dd></dl>";
}
}
//Instatiate a cat & gie it data
$my_cat=new cat('Wiley');
$my_cat->color='grey tabby';
//Now return the cat as a string &echo it:
$catstring=$my_cat->asString();
echo "<pre>{$catstring}</pre>\n";
//and do the same as HTML
echo $my_cat->asHTML();
//NOW construct an acronym definition
$my_anac=new acronym('SCA','Society for Creative Anacronism');
//Covert it into string form:
$anac=$my_anac->asString();
echo "<pre>{$anac}</pre>\n";
//Now output as HTML:
echo $my_anac->asHTML();
?>


Output

Cat - Name:Wiley,Color:grey tabby
  • Cat
    • Name:Wiley
    • Color:grey tabby
SCA:Society for Creative Anacronism

SCA
Society for Creative Anacronism




Download for this tutorial
 

Lesson5 : Using Object Interfaces



    Abstract class as just described are powerful ways to define how new classes are constructed. Sometimes,however,you don't want to fully define a class. Instead you need to specify that classes must implement a certain set of methods. This way you can have vastly different classes created,but all define these methods and therefore can operate the same.



   The can be done by defining an interface. Interfaces are made by using the interfacekeyword instead of class and specifying public methods,just as you would have for an abstract class. Other classes can now use the implementskeyword instead of extends and state that they are going to implement all methods that the interface specified.
       The main advantage of an interface is that it allows you to define a protocol to be implemented for an object to have some behavior.For example,you could have a Comparable interface with a compare method for classes to implement,and every class that implements it would have a standardized method for comparison.