The way to improve programmer productivity.
9:00 AM, your boss suddenly bursts into the office and says: "The market wants our website to have a new fancy login box. Can we just provide the username and password fields? Maybe add a recovery link too." It shouldn’t take more than two days. Oh, I have to go, hurry up!”
Situations like this usually turn people into Roaring Emperors in an instant, but this time, you can stay calm: because You learned how to deconstruct PHP.
What is deconstruction?
Deconstruction is to break down the requirements into the smallest possible fragments, then organize and elaborate these fragments, and finally become a consensus between you (the programmer) and your boss/customer.
It doesn’t matter if someone gives you a ready-made specification. It all starts with deconstruction!
I’m already coding, why do I need to deconstruct?
Yes, maybe you are already tinkering with how to ng-submit() your login form using AngularJS, and it feels much easier than doing it step by step with Struts 1 first. Oh, no, hurry up and pull back from the cliff!
The first thing we need to do is to check the robustness of the requirements. break down. "I want users to be able to log in through a box" is not the right requirement.
Sounds very easy, is it right? I mean, you can do it in just a few minutes, right? Okay, let’s move on…
Are there any real-life examples?
This is true. From my experience, this real example occurred in February 2011, when a German car manufacturer asked for their new website.
Please look at the lower left corner of the picture below. Please pay attention to the login box. It looks so small and simple, but it is actually very complicated. Let’s take a look at why…
First, about how to deconstruct?
You should work hand in hand with technology-driven and business-driven people. So you need to convince the boss to get more INPUT!
Oh, by the way, you can add more people if necessary. However, based on my past experience, doing the deconstruction work with an entire team would be a huge waste of time, money, and energy—but that’s another topic.
Next, open your favorite writing tool and start asking some "childish" questions. Then write down the answers one by one and organize them. What are these "childish" questions? ——"What is that?", "What causes this?", "Why do we need it?", "Are there other parts?".
As for how long? Either you finish asking the question, or others will dislike you
About an example?
Go back to the above example: "We need a login box". Let's break it down first: [1] We need [2] Login [3] box. Assuming [1] is given at that time, then one can start from [2].
Question about the [Login] part
You: “What is login?”
Business person: “Well, username and password should be enough to log in.”
You: “Username or email? ”
Business staff: “All right!”
You: “Wait a minute, who are our users?”
Business staff: “You are so stupid that you want me to fire you?” They are users."
You: "Is that true for everyone?"
Business staff: "Well, yes. However, the top management has mentioned that if they are users who have already bought a BMW car, they can pass it. The customer number logs into the website and automatically obtains the guest account. "
You: "Well, how do we get the forms of these customers? "
Business staff: "Parallel to our own new user database. Oh, by the way, there are several different CRM systems, so that needs to be explained. "
You: "Uh, send them the password, or do they already have the password and just log in? "What if? What to do when the CRM system is unavailable? What is an automated guest account? How did they know they would suddenly be able to log in? ……Help!
=>Continue to ask questions
Pause the meeting first and take a look at the [Box] part
You: "What is the box?"
Business staff: "Almost everything has been designed. The username/password field, Login button. What else is difficult? "
You: "The box only needs to be displayed on the homepage"
Business person: "No, we need to display it on several web pages, such as some activity pages. So it should be made into a component in your CMS system."
You: "Component? Aha. Uh, you Do you know the difference between HTTP/HTTPS? Our website runs on HTTP, which is a bit tricky (putting the inline frame of https on the http page makes my head explode)... Hmm... Do we have to To ensure that users transfer data safely. "
Business staff: "Yeah, yeah. I believe you. Speaking of security, I also need to ban users." Terms and Conditions" before you can log into the corresponding layer. Otherwise, our lawyers are going to call again."
You: "OMG! Ban users? Terms and Conditions? Layers? Layers embedded in inline frames or put to the layer on the parent page?”
=>Keep asking questions
Please! We've only just begun!
There are still many, many contents that have not been covered. For example, infrastructure, SSL-Loadbalancers, forgotten password workflow, error/information messages, etc. And who on earth said “we need a login box”? client? So, who are the real customers?
Regarding the issue of HTTP/HTTPS, technical and business personnel must sit together to discuss before formulating requirements. Without two-way communication, then you're really only living in a dream.
Last but not least, we haven’t even fully deconstructed this example yet – on the contrary, this is just the tip of the iceberg.
Forest, forest, forest, where would a forest be without trees?
After asking a series of questions, we first need to organize and elaborate on these questions. You can't plan or estimate without organizing and explaining it, otherwise, a slight difference can make a huge difference.
Of course, it is definitely not correct to type the code before completing these steps. Let’s refine these questions first, just like panning for gold, discarding the false and retaining the true.
Next step: Yep, still far from done. This is only the beginning of deconstruction.
In future articles, I will continue to write about deconstruction and subsequent steps, so stay tuned. If you have different opinions, you are welcome to correct me.
Receive LAMP Brothers original PHP tutorial CD/"Essential PHP in detail" for free. For details, please contact the official website customer service: http://www.lampbrother.net
|