[Mpango-core] Order please
Status: Pre-Alpha
Brought to you by:
edvera
From: Eduardo de V. T. <etu...@gm...> - 2011-07-16 16:57:18
|
Hi team, I have been working on the mpango-core and mpango-web projects and I feel we should have a bit more order on the projects. First of all, it is unacceptable to have a broken build on the Subversion repository. This is a situation that impacts the whole team and that is easily avoidable. It is as simple as running a mvn clean install before committing any code to the repository. Please pay close attention before committing things that don't even compile! Secondly, all tests that require a running Spring context should be considered Integration Tests and as such should be named according to the following rules: <testName>IT.java. If someone wants to see the difference between an integration test and a unit test, please have a look at AuthenticationServiceTest.java class where we have an integration test called authenticationTest and an unit test called testGenerateResetKey. The main difference is how the related classes to the class under test are created, unit tests create mocks or stubs integration tests rely on the real classes. Third, there were no tests at all for the backing beans in the mpango-web project. Anyone creating backing bean has to create the Unit Test associated with it. This means that for all existing backing beans we need unit tests. Fourth, I see main methods on some of the beans. I don't get the point for having a main method on a Spring Bean and they should be removed. Fifth, there is a bean called ApplicationContextService that returns the ApplicationContext from Spring. This service should be removed and those beans that require the application context should implement the ApplicationContextAware interface and let Spring inject it at runtime. This ApplicationContextService should be removed from the source code as well. Sixth, I see core objects such as UserDAO being used by mpango-web Backing beans. This is not a good practice. If someone needs to implement certain behavior that requires database access (such as the generateResetKey) we should do that in the AuthenticationService class that is located on mpango-core project. Seventh, since we are using Spring we should leverage the solutions it brings in order to ease up development. In this sense I have completely rewritten the ForgotPasswordBackingBean, created a ForgotPasswordMessageCreator and a ForgotPasswordMessageListener. Those involved in JMS topics please take a look at these classes in order to see how Spring enables JMS functionality with a minimum amount of code lines. Eighth, this application will be used by people from different parts of the world and different languages. Thus we need to use the Internationalization means in order to communicate with the user on his own language. Spring allows that by using the ApplicationContext.getMessage() method. So I would suggest that those people that have been working on the above code please change it as mentioned on this email. If you have questions or concerns please don't hesitate contacting me. Hope this is a educational email, no mean to brag on anyone. Best regards, Eduardo de Vera |