True mashier, dare to face the discussion of the straight language

xiaoxiao2021-03-06  53

http://community.9cbs.net/expert/topic/3364/3364776.xml?temp=.1997949 In fact, did not say anything to help questions, the opposite, basically in the debate. Let me fall in the glasses, such a basic problem, I can't understand this, and so, I am so confident in this lack of common sense. It seems that although the truth is more distinct, the debate is never propagated. The post chaos a bunch of piles, simple extracted: Q: How to abstract business interface ... Need to abstain here into an interface to address demand changes; my current problem: What is the method to form a better interface. What kind of principles, etc. M: (1) Try to use the scalable interface! (2) Multi-level interfaces in the vertical direction (inheritance of two to three layers)! (3) Do not spread too wide in the horizontal direction (not too much interface on the same level)! (4) There must be flexibility in the parameter setting of the interface: I really don't know what I'm, I don't know if my understanding is limited. M: ^ _ ^, speechless! The inheritance and interface minimizes never heard? I want to learn from you, you ask this question, I am answering you this way, don't understand? (1) Try to use the scalable interface (not limited to the function of the interface) Void Dosomething (const INT NTYPE) {SWTICH (NTYPE) {Case 1: trydo1 (); break; case 2: trydo2 (); break; .. .................... case N: trydon (); break; default: break;} You may only implement trydo1, trydo2, but the back function Have left first! ! ! ! ! ... (later explanation is not written) I: From the above explanation, it seems that you are quite shallow to object-oriented. The reserved interface and flexibility mentioned are basically on the function level. This design is mainly to coordinate the relationship between the programming block module (and whether these design principles are established), it seems to have an abstract service interface. Nothing help.

M: As for these few words I said, there is no help to abstract business interfaces, that is really right, because I didn't see how I abstract business interface, but this is the principle of design interface J: Your name is over-design , ... what is the principle of our design? The more simple and better, how can you predict future customer needs? M: I have listened this sentence "What is our design? What is the better, how can you predict future customer needs?" Well, I think I am not good to say how much software project The book, the original book is wrong! I: We design procedures, no matter what technology and design methods, it is inevitable: you can't provide maximum flexibility in all levels! ! ! Regardless of the design and methods, it is inevitable that there is a flexible while other aspects leading to complex and modified costs ... It is impossible to provide flexibility, asking us to make a hierarchy, then what kind of 取舍 is reasonable? Of course, the structure is similar to the structure of the actual problem, so that the rigidity in the program is also global and stable in reality, and the flexible part of the reality is also implemented in the program. If we open two programs now, one is the student's student status management and the other is the order management of the commodity. The results found that the two programs appear to appear to be exactly the same ... This shows that the program is extremely lacking business model, and it can also be very fragile when the program can be confirmed in the face of modification. For example, students have turned into a fixed-class system, now become a credit system; or items need to be discounted because the promotion needs to be discounted. The programmer is likely to grow his mouth. It seems that it does not understand the customer. It seems that such modifications will be put forward after the procedure is completed, but I have forgotten that these situations are how universal and successful . Because he didn't think about the software management of a student status at all, he had to move a bunch of data from here. M: If you leave the interface like I said, I am afraid there will be such a problem. ... // Enter student grade, t_score is credit, t_creditour is credit setscore (float fnum, int ntype = t_score / * t_creditHOUR * /) You said that I don't know what you are, ^ _ ^ ...... There is nothing to take extremely, I said that I have reserved the interface, not to reserve thousands of thousands, what is not good. I: I must of course reserve the interface, ... the problem is that I will repeat again: You can't provide maximum flexibility in all your temperament! ! ! Just as you also say, you can't take extreme, you can't stay thousands of interfaces. So I inevitably exist, there is no trade-off. And I said to be reserved, how do you know when it is too much? Let's take an example of object-oriented, ... Now you have to write a drawing program and draw a lot of rectangles to the screen. Smart programmers began programming, very simple, he wrote such a program ...: for Each Rect Do Draw (Rect.top, Rect, Rect.right, Rect.Bottom: Integer; not smart programmer Very smart, he guessed that customers would not talk so much, tomorrow, he will draw a triangle, or 5-sided.

转载请注明原文地址:https://www.9cbs.com/read-113721.html

New Post(0)