当前位置:网站首页>The architect started to write a HelloWorld
The architect started to write a HelloWorld
2022-07-05 03:34:00 【Resourceful!】
Architects don't make tools , I made one today helloworld!
Today we don't talk about technology , Talk about transition design .
We use helloworld For example ! Ordinary programmers write a Java Output hello world Program ! Architects have a look , Look disdainful . Looking for nails everywhere , Your program is too low 了 , Multilingualism is not supported , Friendly extensions are not supported !
Then the architect started to write a hello world!
The architect's thinking is as follows :
main In the function print once ?
Too process oriented , too low 了 . You have to encapsulate a class . It's called Printer,Printer There is a member method , It's called print.
however ! Just one class is too low 了 , What if there are different implementations in the future ? So we have to add an interface .PrinterInterface.
however !interface There is no realization , Default or default . So we have to add an abstract class ,AbstractPrinter Realization PrinterInterface, then Printer Inherit AbstractPrinter.
however ! You have such a set , How to create an instance ? direct new Printer()? too low 了 , That's called implementation dependency . Definitely not , So we need to build a factory class ,PrinterFactory,PrinterFactory use PrinterInterface Return instance , This hides the implementation details .
however !PrinterFactory It is also an implementation class , too low 了 , So there must be PrinterFactoryInterface,AbstractPrinterFactory.
And in PrinterFactory How to write it in it ? direct new Printer() ? too low 了 . Or implementation dependency .
Last , You have to put this pile of things together in code , It's too ugly , Various new Implementation class . too low!
Fortunately, we have an advanced thing , It's called dependency injection ! Write the program object structure into the configuration file . Of course, you can't make your own wheels . To configure Spring Well . So much lib, On the command line or IDE Project management is definitely not enough , You have to have dependency management .Maven ah Gradle Ah, come on .
Last , want print How can I pass something to the program ? Hard encoding ? Command line arguments ? too low! Of course, it has to be written in XML Inside .
Light is a XML Of course, it's not enterprise class , Plus DTD Verify it .
Then it comes to XML The problem of analysis . Directly operate in the code parser Do you ? too low! Of course, write a parser The wrapper class ,interface,abstract class,implementation class,factory class Another set . After all , Can't rely on Implementation , If I change in the future parser What should I do? .

Architect version helloworld
IDE You have to install it 300 A plug-in , Open the project hard disk and eat it for a long time 2GB Memory , Then a bunch of plug-ins pop up and ask for an upgrade .
oh , Before this happens , I have to draw UML What about the picture? . Three years later, the project was completed , Deploy to the client's server for a run , Break down immediately , All over the place stack trace.
Originally, the client server used JDK 8 And new projects need JDK 11. Then ask the customer if you can't upgrade , The answer is no , Because the enterprise solution made by another enterprise development group only supports JDK 8. Then the customer scolded your architect , You've done so much design that you never thought you might change JDK Do you ?
Inside code review, The architect is still proud to say , Although I don't often write code , But my code is extensible !

Architects talk on paper
After the meeting, a group of people were talking , Architects seem to have written less unit tests ; There's no documentation ; Others say that the architect's single node hello world What to do if I hang up ?
You have to use microservices ,redis,nginx,docker,k8s wait devops ...
Everything has to be arranged , Doing the job of making artillery battles , With the heart of building a nuclear bomb !
边栏推荐
- MySQL winter vacation self-study 2022 11 (9)
- [Yu Yue education] National Open University autumn 2018 8109-22t (1) monetary and banking reference questions
- Ask, does this ADB MySQL support sqlserver?
- v-if VS v-show 2.0
- Delphi read / write JSON format
- Talk about the SQL server version of DTM sub transaction barrier function
- Difference between MotionEvent. getRawX and MotionEvent. getX
- [groovy] string (string splicing | multi line string)
- Kbp206-asemi rectifier bridge kbp206
- Linux安装Redis
猜你喜欢

【软件逆向-基础知识】分析方法、汇编指令体系结构

线程基础知识

De debugging (set the main thread as hidden debugging to destroy the debugging Channel & debugger detection)

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety

Linux安装Redis

SQL performance optimization skills
![[groovy] string (string splicing | multi line string)](/img/c7/2471d13e5d49cca3727d05b4f9fb36.jpg)
[groovy] string (string splicing | multi line string)

Port, domain name, protocol.

Three line by line explanations of the source code of anchor free series network yolox (a total of ten articles, which are guaranteed to be explained line by line. After reading it, you can change the

Use of kubesphere configuration set (configmap)
随机推荐
51 independent key basic experiment
Yyds dry goods inventory intelligent fan based on CC2530 design
[deep learning] deep learning reference materials
ICSI213/IECE213 Data Structures
[groovy] string (string type variable definition | character type variable definition)
Daily question 2 12
[learning notes] month end operation -gr/ir reorganization
问下,这个ADB mysql支持sqlserver吗?
1. Five layer network model
問下,這個ADB mysql支持sqlserver嗎?
[luat-air105] 4.1 file system FS
Simple use of devtools
Multi person online anonymous chat room / private chat room source code / support the creation of multiple chat rooms at the same time
Linux Installation redis
端口,域名,协议。
qrcode:将文本生成二维码
Kuboard
How rem is used
【web审计-源码泄露】获取源码方法,利用工具
[2022 repair version] community scanning code into group activity code to drain the complete operation source code / connect the contract free payment interface / promote the normal binding of subordi