Home > Software engineering >  Did not make this kind of question, please advise
Did not make this kind of question, please advise

Time:10-03

A printing software, understand difficult, because of the lack of documentation and try so hard, the main interface and the print preview screen, right-click pop-up menu now two interface is the same, asked to take a class by a set of code to implement, so the question comes, how to let them share a set of code, how to make their message response together? Thank you for your environment.

CodePudding user response:

See two interface right processing function

CodePudding user response:

Two interface is now two sets of code, though some are called common interface, Shared leadership mean taking a class to form a set of code, I didn't quite understand what he meant, now two interface right-click pop-up menu resource ID is same, is to let them in a class a common response to a set of response function?

CodePudding user response:

Please keep in mind: the source code itself whether writing structured object-oriented or comply with the design patterns or agile... Is not important, the important thing is whether you using structured or object-oriented or comply with the design patterns or agile... Method named identifier, read, modify, inspection, test source code,

Mean you program structure seems more reasonable, more concise, does not necessarily than looked a mess when running or modify the program structure are less likely to make mistakes, more convenient to modify, wrong where is easier to find the cause of the error and the error, it is easier to correct mistakes,

Try comparing
Library (on the classification of the book is structured enough)
And
Any search engine (is considered to be a flat structure data, only support full-text retrieval)
Which to process information more convenient, more efficient,

So
Rather than strive to refactor your code make it looks more concise, more reasonable
Learn as laborious grep, sed, awk,... This kind of full-text search and batch editing tools,

The more complex structure, the harder it is to change, the more difficult it is to debug,
Sometimes (or even most of the time), seems more reasonable, more concise code, run up the worse performance, when something goes wrong, the more difficult it is to find reasons to find what went wrong after correction, the more difficult,

Programmers do not try to avoid mistakes, but focus on quickly discover and correct mistakes, really in a quick way to solve the mistake easily, "rapid failure" than "to prevent error", Fred, George

Before Microsoft c # editor's development director Jay Bazuzi listed some questions to help find the right direction; He felt that former colleagues should use these questions to ask yourself; Actually regardless of where is the work of developers should always ask yourself these questions:
In pieces to ensure this problem will not appear again, "what should I do?"
Pieces to a less "Bug, what should I do?"
Pieces "to ensure that the Bug is easy to be repaired, what should I do?"
In pieces "to keep on changing fast response, what should I do?"
In pieces "to ensure that my software running speed, what should I do?"
If most of the team can ask yourself from time to time, is bound to benefit from, because these are really powerful,

CodePudding user response:

refer to the original poster weixin_37718915 response:
a printing software, understand difficult, because of the lack of documentation and try so hard, the main interface and the print preview screen, right-click pop-up menu now two interface is the same, asked to take a class by a set of code to implement, so the question comes, how to let them share a set of code, how to make their message response together? Thank you for your environment.


Preview and print the main code is not too big difference, are drawing on dc, is just a dc screen, one is a printer, because the printer is page to print, and there is only one screen, so the control will be different

CodePudding user response:

If I can write a right-click menu
class?Specifically to implement the right-click menu
If you need at the time of this kind of initialization can mark is in print or print preview interface

CodePudding user response:

Main interface and preview interface is inheriting from a class, give it a try
  • Related