Using the Factory Method template
seen from United Kingdom
seen from Germany
seen from United Kingdom
seen from United States

seen from United States
seen from United States
seen from Yemen

seen from United States

seen from Canada
seen from United States

seen from Canada
seen from United States
seen from Philippines
seen from United States

seen from United Kingdom

seen from Malaysia

seen from Australia
seen from United Kingdom
seen from Netherlands
seen from Yemen
Using the Factory Method template

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
設計模式 - Factory 比較
Factory Method:在一個抽象類別中留下某個建立元件的抽象方法沒有實作,其它與元件操作相關聯的方法都先依賴於元件所定義的介面,而不是依賴於元件的實現。
當有一個或多個元件無法確定時,會先確定與這些元件的操作介面,然後用元件的抽象操作介面先完成其它的工作。
主要精神是inheritance(繼承),在創立物件的時候繼承一個工廠類別再把方法override掉。
Abstract Factory:需要一組可以隨時抽換的元件,並且希望可以簡單地一次性抽換。
主要精神:composition(合成),利用簡單的物件去組成複雜的任務。
Simple Factory:又稱Static Factory。一個Simple Factory生產成品,而對客戶端隱藏產品產生的細節,物件如何生成,生成前是否與其它物件建立依賴關係,客戶端皆不用理會,用以將物件生成方式之變化 與客戶端程式碼隔離。
ref:https://openhome.cc/Gossip/DesignPattern/
June 24, 2016
Continued refactoring the classes to improve the code.
Using factory method because php does not support overloading methods or multi constructors
Been looking into software architecture so that the app is clearer for me to understand.
The difference between creating an instance of a class in Ruby and an object in JS
I've been using Ruby almost exclusively for the past couple of months. I've written a bunch of console applications, sinatra web apps, and messed around pretty extensively with active record. Almost all of my applications have required setting up classes and those classes have all been used to render instances of themselves. I was just starting to get comfortable with Object Oriented Ruby, the concept of inheritance, and the usefulness of modules (read this http://www.amazon.com/Practical-Object-Oriented-Design-Ruby-Addison-Wesley/dp/0321721330)...then JavaScript came along. Everyone is always boasting about how elegant a language Ruby is, and how it's one of the best languages for beginners because it's syntax is so easy to pick up.
Before learning about Object Oriented Javascript I had learned how to manipulate the DOM, and written basic scripts to activate and deactivate my cool CSS3 animations, but I had been using jQuery almost exclusively. It's methods reminded me of a bulkier Ruby, but I quickly saw it's potential after creating this simple script for changing every image on a page to Miley Cyrus (load in console: $('img').attr('src', 'http://hvngrymag.com/wp-content/uploads/2014/03/Miley-Cyrus-Is-Singing-to-Who1.jpeg')). Coming from Ruby, OOJS can seem kind of daunting. Let me show what convinced me that it's not.
Let's create a Person class in Ruby:
class Person def initialize(first_name, last_name) @first_name = first_name @last_name = last_name end def say_hi "hello there" end end
Sweet. We've just created a class with a few instance variables and a say_hi method. Now whenever we create a new person for our application we can just write:
phil = Person.new(“Phil”, “London”) #=> #<Person:0x007f863b08e968 @first_name=”Phil”, @last_name=”London”&rt
Now that we have a phil, an instance of our Person class, we can try to figure out some information about it:
phil.first_name #=&t; undefined method `first_name' for #<Person:0x007f863b12a408&rt;
Actually, we can't even figure out phil's first_name. The only thing we can do at this point actually is call the say_hi method. Let's do that:
phil.say_hi #=> "hello there"
If we want to figure out the first_name and the last_name attributes of phil, or any of our other objects created from this class, we need to add attr_reader methods before the initialize method. We could also use the attr_accessor method, which would allow us to edit and read the first_name and last_name attributes.
class Person attr_reader :first_name, :last_name
Now we can call say_hi, first_name, and last_name on phil, and any of the other objects that we create in the future.
Let's see what this whole thing would look like in JavaScript:
var createPerson = function(firstName, lastName) { return { firstName: firstName, lastName: lastName, sayHi: function() { return “hello there”; } } }
We have just created a function that can create an object, which has the properties firstName, lastName, and sayHi. sayHi is a property and it is also a function, pretty cool! If we want to create phil again we just say:
var phil = createPerson(“Phil”, “London”) phil > { firstName: 'Phil', lastName: 'London', sayHi: [Function] }
We now have all the same functionality from our OOJS phil object that we do with our phil object that we created in Ruby. Our OOJS method createPerson is known as a factory method. We use factory methods when we know we'll be creating objects with the same interface, i.e, when we know each person will have a first and last name, and they'll be able to say hello!