How to achieve high cohesion, low coupling
Do a website including individual members and merchant member Merchant member's function including merchant login to modify business information change merchant account password Business Forget password merchant submit order and other functions write these functions into a class for example, the merchant class writes these functions in the form of methods and then partially complex functions are then separated into another A class or the next method to write to this merchant class want to ask this is not high cohesion if not how to be considered high cohesion simple functions such as display business information to modify business information business forgot password and business change Password write to business class in this does not calculate the cohesion
------to solve the idea----------------------
Plan the function module there's something you need to do while you're doing it, and just start thinking about it unless you have a lot of experience. Next, if it's a new project, then you might not be able to write anything. High cohesion low-coupling code still needs modification modification
------to solve the idea----------------------
References:
Quote: References:
Quote: References:
Like editing information, change password, retrieve password, login registration and so on is basically all user types are used to get the function, so write a parent class implementation let the member and business inheritance, and then separately develop their own independent functions
In fact, the initial site, does not involve performance issues, the individual does not recommend too much attention to technology, the user no matter how good your code, experience to survive
In fact, I agree with you this point of view, but still want to see the size of the project, if the big project to consider the future development must be the beginning of the appropriate planning, otherwise like the development of the city to a certain time there is a very serious bottleneck.
That's how it's done now. Because there is no plan to change the function is very difficult to change a place involved in a lot of places to feel more and more messy, just want to write easy to expand and update the code or if you have a good book on the internet to search a portion of the information also read some really to the practice is not Special Understanding
A book with this design pattern can be seen but more general at least some of the patterns are going on I think I need to know.
I used to write a book before the blog recommended you look at it I am too lazy to turn over