The fourth chapter summarizes OOP blog

This architecture means two operations

These two operations are all oriented demand (instructions) designed to be more convenient to achieve a defined function on the instructions of the goal, and there is no completely right Uml tree modeling. And because only increased demand between the two jobs do not have to reconstruct the existing architecture, so this just shows the architecture of the last job.

The first architecture design jobs

The first operation involves only UmlInteraction, ClassManager, Operation three classes, and a Main class. Since the first operation involves only query the class diagram, class diagram and property operations is a key element of classes, interfaces, classes, and interfaces, classes, and the relationship of these.

Of classes and interfaces, I modeled a unified, with ClassManager to characterize (although classes and interfaces differ, but it can be integrated into a model). ClassManager responsible for a note of this class name \ interfaces, including attributes, operations, and inheritance, which is associated, the realization relationship. For class attributes, operations using ArrayList organization and management, the relationship of the end use of the record id ArrayList class this class to implement (i.e., a bit like a linked list structure of FIG recording method).

For operation in classes and interfaces, also separate modeling. Operation is responsible for recording under the name of the operation, visibility and parameters, if there is a return value and other information.

For the properties of the class, not for individual modeling because UmlAttirbute not contain other elements, that is the smallest element of its own, it does not need to be directly used for modeling UmlAttribute separately.

Finally UmlInteraction only responsible for creating and maintaining ClassManager needs to implement the query on instructions by the methods provided by ClassManager.

The second architecture design jobs

With the addition of the second operation sequence diagram and a state diagram, it is also added StateMachine, Sequence corresponding modeling. UmlGenralInteraction inherited last UmlInteraction, first of all UmlElements father threw the constructor resolved, then the elements belonging to the state diagram, sequence diagram of the elements belonging respectively to create a StateMachine or Sequence examples and then thrown back on. Finally, you can just use the query method StateMachine and Sequence offer.

For the rule checking, the first rule to implement a simple self-examination method in ClassManager, and then only need to call this method for each ClassManager in UmlGeneralInteraction on it. The second rule is to graph traversal to find there is no ring, we created a separate class method GraphCal, only method (no brain dfs traverse) which can be implemented need to call. The third rule, a simple breadth-first search to see if there is no duplication inherit it.

Architecture design and understanding of the evolution of OO methods

Architecture design is the greatest progress in this regard, to get a problem to think about this question, there are several roles (need to model several classes), rather than the issue should be completed in several steps. Although the relatively small size of the problem when, according to several steps away thinking indeed can be more easily resolved, but for a little complicate matters, in accordance with the object-oriented thinking is indeed a good solution more. This question involves what role, what their responsibilities are, we just need to clear them, and then go on to assign tasks, each class to achieve their own responsibilities (there may need to be divided into subcategories secondary). Such a solution closer to the division of labor system in real life, but also help people to understand.

Secondly deepest feelings is imperative programming. The interaction between class and class should not involve too deep, a class needs to work another class, another class should not be the properties, methods, take over, and then themselves to achieve, but should tone of command, "I to you do this, the final results tell me on it. " In such a way to design, in order to better reduce the degree of coupling between class and class.

In addition, for further understanding of OO, OO design is great for learning the principles and 6 design patterns, such as: factory mode, proxy mode and so on. Although many design patterns, design concepts in our operations difficult to apply, because the problem of job size or smaller, but they know in advance will help to further my understanding of OO.

Evolution test understanding and practice

For testing biggest progress in this regard is that what is learned and how unit testing unit testing. Junit test code by writing unit tests targeted, can indeed achieve more accurate test each method is not expected to differ with.

In addition, the practice of using python further build data generator and evaluation machine. Data Generator most important thing is dependent on regular expressions based on random generation function, and write their own evaluation of the machine is a simple metronome.

PS: OO program fully proved that I was a test of patience it was lazy child.

For practice, the process of completing the job, more and more able to spend more time to analyze the needs, the need to complete the requirements listed on the instructions or what needs to realize what input information recording and think about what kind of data structure to organize this information, as well as for special consideration and attention to the situation. And this time analyzing the demand for investment in the previous increase, but also makes me more relaxed programming code, coherent increasingly clear. This is my greatest progress in work practices.

Harvest courses

We mentioned before the biggest gain this course lies for architectural design and object-oriented design of learning and the application of its practice. It made me feel for the first time to truly understand some of the principles of some of the industry are now doing the project will follow, so that my freshman from the kind of simple no brain Mang code logic will become realized is reasonable to consider written (US) whether easy to maintain and debug, we had a kind of code for aesthetic pursuit.

Moreover, this course also the first time I will be prepared to consider user input and other illegal procedures involving robustness, which is before the study is not felt. Earnestly solve the user's hand to enter illegally made me realize that in the actual project development, users often do not interact with input according to your expectations, you need to take this into account and carry out the necessary preparedness user guide.

Suggestions for Improvement

  1. Recommendations laid down the timeline do not easily change, because accustomed to this time line, a sudden change of time, can seriously disrupt their own arrangements, and can affect people physically and mentally restless (that is, feeling a little idle), had Friday night see instructions on weekends you can finish the liver, but after the time shift, Fridays and weekends do not know that doing the (emptiness uncomfortable).
  2. Personal feeling, a unit of the last job did not help me to understand further the Uml. Simple analytical Uml, do people have a deep Uml image of a tree, but for the concepts of understanding or not very deep (like the similarities and differences between the polymerization and combinations, I can not remember, every time the Internet check). However, experiments on the course are great, personally to design a class diagram, or is looking for class diagrams, state diagrams, sequence diagrams are not self-consistent between the local, are able to help us understand the core concept of Uml. Personal feeling is to enable students to design their own Uml class diagrams, etc., and then to be able to realize people feel a complete design flow according to their own design, such as the experimental design is Uml class diagram class, and then the next course is practical work to achieve own design (although not to check class diagrams and code implementation matches, but this push to allow students to want to do a great workout). If they can add assistant or teacher recommendations to students in design between the two, the better reviews.
  3. After the experimental class, reference may provide some answers (some experiments need to feel) the experimental content. For example, the last two Uml experimental class, after class can build a post, announced it refer to the answer, let us realize that the teachers how to think, contribute to the understanding of experimental content.
  4. About jml that unit, the job demand is still not need to see the specifications can be done, after all, look at the name of the instruction guide book needs a lot we can probably grasp, so this unit feel a bit tasteless. Because in fact, not only me, there are some students around me, simply do not see how the job specification is complete, and therefore do not understand the meaning of jml (probably because we are too common functions implemented). But personally feel that meaningful learning jml is not too large, designs for the division only need to provide the appropriate interface good, then people can work on their own, while the marginal conditions for the expression can also annotate a document or a very clear way clarity and no need to rely on jml not everyone understand about the complex specifications.

Guess you like

Origin www.cnblogs.com/Melles/p/11068546.html