- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 253字
- 2021-06-25 20:49:30
Building your own PC
Imagine that you have a shop where you sell PCs.
Regular PC consists of the foll:
- Motherboard
- CPU
- Graphical card
- RAM
Most of your customers don't actually care what components you put in this PC. What they do care about is whether this PC will be able to run Magnificent Pilfering Car 7 at 60fps (which is frame per second).
So, you decide to build it like that:
data class PC(val motherboard: String = "Terasus XZ27",
val cpu: String = "Until Atom K500",
val ram: String = "8GB Microcend BBR5",
val graphicCard: String = "nKCF 8100TZ")
So when a new customer comes in wanting to try out this game everybody is talking about in the neighborhood, you just do:
val pc = PC()
And they are already off toward home, ready to share their newest experiences from MPC7. Actually, your business goes so well that you have one PC just sitting there, ready for the next customer to come in.
But then another customer arrives. And this one is tech savvy. So, frankly, they think that for the games they play, a nKCF 8100TZ graphic card wouldn't be enough at all. They've also read that there's now BBR6 RAM available and they want 16 GB of it. And of course, they want it right away. But they're willing to pay in cash.
That's the moment you wish that you could just modify this PC that's sitting in your warehouse a little, instead of assembling a new one.
- Java程序設(shè)計與開發(fā)
- Visual Studio 2012 Cookbook
- Spring Cloud Alibaba微服務(wù)架構(gòu)設(shè)計與開發(fā)實戰(zhàn)
- ThinkPHP 5實戰(zhàn)
- Visual FoxPro程序設(shè)計教程
- Linux核心技術(shù)從小白到大牛
- Ext JS Data-driven Application Design
- Developing Middleware in Java EE 8
- Linux環(huán)境編程:從應(yīng)用到內(nèi)核
- Visual Basic程序設(shè)計習題解答與上機指導(dǎo)
- Python:Master the Art of Design Patterns
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術(shù)
- Advanced Express Web Application Development
- Node.js從入門到精通
- Ext JS 4 Plugin and Extension Development