Confucius said: "If you don't think about it, you don't think about it." From my experience experience, I am deeply sighing the ancients.
One project when I graduated in my graduation design was a graduation design management system. At that time, the teacher gave us a request to achieve JSP and JavaBean. I am mainly responsible for project modeling and javabean section, and later responsible for database students cannot return to school by SARS, so the database section is also completed by me. At that time, the knowledge of Java was very poor, only a simple grammatical foundation, even JSP, JavaBean was heard for the first time. I don't know where to start, so I've been a very simple demo project given by the teacher. First, JavaBean is a relatively simple thing, so I start analyzing user needs.
How do you describe it? Due to the limitations of school education, plus themselves for a long time, politics, English (what to do with everyone), causing the serious lack of knowledge. I will establish a list of their needs with the graduation designers. But such a demand description is very side, almost all static needs, and it is difficult to design a few user interaction processes, and changes in certain states. And whether this requirement really meets the need to be a problem, so I immediately design the web interface with my classmates, and the purpose is simple, because the user's needs are implemented through the interface, and the design of the interface can cover the function of the ultimate submission user, and You can also explore a lot of non-user needs. This will be available when I have these functions. After a year, I took careful experience analysis. After UML, I feel like I won the treasure. The knot is all open.
How to build it? I really didn't have a concept, although I know UML, but I only know fur. So I am very simple from the perspective of the object, first find the personnel involved in the graduation design management system, this is obviously found, involving students, teachers, administrators, further extracting project objects, each person Message object, graduation design document object, etc. Next, the database table is designed. Because the school teaches the database, only the transformation of the ER map to the relational mode is not explained, and the ODL to the relational mode is not transformed (now, ODL should be better, understanding O / R mapping More help.) So you draw the ER map, build a variety of tables, set the primary key, foreign key, and so on.
The primary issue I have encountered is how students, teachers, and administrators should do. Every object built a table, it seems that there is no problem. But there is a problem when establishing a message object, because the news is to be transferred at the students, teachers, and administrators. When I built a message, it is designed: one message content, message transmission People, the recipient of the message (the message content and sender a table, in order to solve the redundant receiver alone, this news is very flexible, the message sender can be the casual one between three characters In addition, such a message can be a message generated by a system, and the recipient can be casually. However, the problem that brings to the message is: Who should the recipient should refer to? Obviously fill a sender, the receiver's ID is not enough, and must even fill in the role of the sender. The second method, each role has a list of received messages, allowing it to refer to a single message table ID, which can also solve the problem. The third method, combining students, teachers, administrators into a user table, then sending people, the recipient will refer to a universal user ID as long as it is a simple reference. This method of consolidated subclasses causes teachers and administrators to have some NULL values, but considering that teachers and administrators are far less than the number of students, such redundancy is ignored. Finally, I still chose the last way. But I still think that the object model is a compromise to the relationship model.
Then I started designing Javabean, accessing the database is a simple JDBC. Because I don't know which attributes I have to access an object on the front interface, I don't know. So I can only take out a complete object from the database, let him decide which attributes are to access. And the modification of the object is also the case, the front desk modifies the properties of the new object, I will make more database synchronization. So my Javabean has a method of log: LOAD (), store (), update (), delete (), synchronized method, and database table synchronization. This seems to be a year later, in fact, I have already made an O / R mapping work. At that time, I did this, which is a quite painful thing, and the method is also the most coarse, that is, the entire object is more database synchronization, even if there is no modified attribute synchronization, so if you want to sync, you must first take the object first The database is taken out, and then write it back. Moreover, all attributes must be NULLABLE's Non-Primitive Type. The second question, how does the foreign key in the table react to bean? For example, each student has a counseling teacher, it is obvious that the student watch needs a foreign key to refer to the teacher ID, but is a Teacher object, or the teacher ID value, it should be a TEACHER Object, but I think this is how hevy is! Think about the teacher's situation, a teacher has a collection of Student objects to "heavy"! Means Load a teacher to take all students. So the method I adopted is: or objects, such as Teacher's student properties, or a Collection Student object, and provide a loadstudents () method, the Load Teacher object is not load student properties, only beans users explicitly When you call LoadStudents (), a set of Student objects will be loaded. This seems that I don't consciously realize lazy loading? The javabean prepared at the time is now examined, the biggest and largest mistakes are to mix Data Access Object and Business Workflow together. For example, all the functions to be called by the teacher in the teacher object, and some functions are sometimes involved in several beans. It's a horrible design, although I was confused at the time, but I didn't have a brainstorm to solve it. I now look at the session bean's idea, I feel so comfortable, nature.
At that time, there was a process about JSP. JSP is only responsible for display, but why is a JSP submitted data to handle another JSP? This is very uncomfortable, so I have the initial servlet to do the idea of the controller, but I can't study so much, and I have not finally realized. After all, the front desk is not I am responsible. When I now know Structs, MVC Model2, my previous confusion is solved. It feels very comfortable again.
The above is some of my newcomer's first project. It is done in a very close-up environment. Internet access is called card dialing. It has not been exposed to mainstream technology, but it is the countless confusion that is accumulated in this environment. When I encountered EJB, Hibernate, Structs, such as drinking, quickly absorb their nutrients. Otherwise, I want to learn that these technologies are undoubtedly a very time, because there is no more technology to resonate, I don't know what they want to do, and I have a resonance, they have these frames, it is Heart doubtful lock. If I returned to the beginning of Confucius, in fact, I have been in the project, I have been "thinking" according to my own thinking, so I often feel tired and there is no income, "殆". But if you don't act on your hand, the optical J2EE will inevitably confuse, that is, "罔". I feel that there is a confusion first, and it is a very effective and consolidated approach to the technology, and it is very creative, and it is a way of thinking. So I encountered the problem, first, I need to think about how to solve it according to the constant, and I will find how others solve it, so my own increase is very rapid.
RE: Summary of the first engineering of the novice (the first time to write articles, ask for advice) Published: Oct 1, 2004 3:47 PM Reply Posted by: NapoleonN published Articles: 20 / Registration time: 2004-09 I am using EJB, STRUCTS to rewrite the project. Although I have been quite clear about the entire demand, I have the first project as a prototype, but I still try to use the method of comparative specifications. First, many USE CASEs are analyzed, and the Rational RequisitePro is used to track changes in demand. Then use ROSE to paint Use Case Diagram. Draw SEQUENCE DIAGRAM for key object interactions, draw State Diagram for some objects. Finally, I naturally export the most important class diagram.
I am now the biggest confusion in the Entity Bean, when modeling, there will be a User object, Student, Teacher, Manager object inherits from this User object. How does the database table design? The first one, three objects, corresponding to StudentBean Teacherbean Managerbean three EntityBeans. The second, three objects a table, only one Userbean. The third, put the user alone, then four objects, such a child, to map two tables EntityBean can't do it. No matter what design is used, let's examine the document to Docbean, we mainly look at its CMR section, a CMR is an Author property, it should be one of the three role objects, the problem is, if three objects Three tables, then how do the CMR here? Public Abstract StudENTLOCAL GETAUTHOR ();? Public Abstract TeacherLocal getAuthor ();? Public Abstract ManagerLocal getAuthor ();? Take a table in the second, three objects, only one Userbean. Then there is quite simple to use only public abstract userlocal getauthor (); then only the second method can solve the problem, that is, there is only one User object, so I have to modify my model in order to use EntityBean, put the original clear three An object is combined together, although it is easy to upgrade a student in the future, this situation is very small in my example, and the database of the database is given Teacher, Manager forms a lot of null values, although this is ignored, but it is not an elegant practice, the most critical is that my object model has compromised to the relationship model. Another problem with CMR is that the CMR must put all related beans in a package, in an XML file, the Entity Bean in my project is needed to be more User, then I need to put these beans. Pracing a package, describe using an XML! My still a small project, if a project has 100 Entity Beans, these Entity Beans are related to each other, then I have to put this 100 Entity Beans into a package, with an XML configuration! How long is this XML file! A small error is all over.
It seems that Entity Bean is really flexible as many people say, I have begun to tend to use Hibernate to do lasting, but I need enough flexibility, I want to inherit and support, it is still very important, In this way, it can be truly "Object-Oriented Domain Models" mode, not a database-centered manner, reference Hibernate's sentence "Hibernate May Not Be the Best Solution For Data-Centric Applications That Only stored-procedures to import the Business Logic in the Database, IT IS MOST USEFUL with Business Logic in the java-based middle-tier "I am also very concerned about AOP, because it is too exciting concept, there is AOP that We also have to do anything, the functionality of the container can be implemented through AOP, just like the Spring framework, in addition to almost no distribution can be supported. JBoss4.0 has also been implemented by AOP. Investigate my project, I found that there is such a need to meet, that is: You must test whether the call to this method exceeds the deadline before performing some business logic, such as students to choose research topics, if you choose, if you choose, you can't Select again, although this method can be solved by the front desk, but I think that the business logic layer prevents the occurrence of this behavior is a part of business integrity. Through AOP, it is very good to call the common function of such a lot of methods as an aspect. My problem is that the EJB running in the container can use AOP? In JBoss4.0, all EJBs are available through the AOP mode. It seems that I am a multi-level service level should be feasible (using JBoss AOP), but such EJB is in other containers. how about it? Will it affect the intervention of EJB? Please visit the predecessors.
Re: The summary of the first engineering of the novice (the first time to write articles, please advise for seniors) Published: OCT 11, 2004 5:43 PM Reply Popular: Standino published article: 1 / Registration time: 2004-10 I It is also thinking about this problem, but I think EJB is more to provide a service. So during modeling should be an interface to define some services. A specific object, for example, Student can use a simple Java class. Don't there be such a trend now using POJO. The younger brother is the door ax, the words are not right, please advice :)
Re: The first project of the newbie (for the first time writing, please advise) Published: OCT 18, 2004 10:18 AM Reply Popular: Extreme Deep Blue Post Articles: 8 / Registration time: 2004-09 It's a good article, good at thinking. I feel embarrassed in front of you. Can you know you?
Re: The summary of the first engineering of the novice (the first time to write articles, please advise for seniors) Published: OCT 18, 2004 1:52 PM Reply Popularity: leeyangcn Posts: 3 / Registration time: 2004-09 Confusion and then confusion, I feel deeply in this process. I used to be extreme perfectionism. It is not the latest and most mainstream technology. I always do it. I think that I will have time to get a holiday, and later gradually recognize this idea, it is very important. It is very important to improve the technology. a process. But I don't know so many Rational this Rational this Rational, is it my own, these things are very expensive, and the general companies are not. And just graduated, you can have a regular analysis design, which is also very difficult. Re: The summary of the first engineering of the novice (the first time to write articles, please advise for seniors) Published: Oct 18, 2004 3:40 PM Reply Posted by: Napoleonn published article: 20 / Registration time: 2004-09 Rational, but it is only a trial, mainly for the RUP process. In fact, the general company does not have this expensive thing. It can use some other tools to replace, but some key work is to do. For example, the management of the needs, especially the changes in demand.
Regular design, I also said that it is not good to make a formal, in fact, it is a solution that solves the problem. It is just that the predecessors practice feel good, and it is widely used.
>> and just graduated, you can have a regular analysis design, which is also very difficult. No one has stopped you stop you to make a comparative normative analysis design. The only limit is our own understanding, so constantly learning can constantly break through .