UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Review of latest code




2008/7/30 Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
I finally started reviewing code.
First thing that caught my eye:

HomeServlet.cpp:


string csp = "HomeView.csp";
....
RequestDispatcher* destination = request.getRequestDispatcher(csp);

This contradicts tech spec:
http://www.total-knowledge.com/wiki/index.php/UU_Templates
---------------------
Template organization
Template mappings
Templates (CSP pages) will have identical names, and will be mapped to subdirectories named based on theme.

I need an example of the correct mapping. The current code wasn't changed since (in that respect) since Sergey developed it.
 
Now, HomeView.csp itself.
Currently it's doing lot of data retrieval work from DB.
This sort of conflicts with the original idea of having all data retrieval be done from a servlet,
and passing the data as request attributes.
(This, by the way, would prevent your exception handling problem we discussed on IRC).

This is Ok. I wouldn't worry too much about:

1) Performance: we need to retrieve these data one way or another. It doesn't matter where - the retrieval time is the same. Actually, generating data into the memory in the servlet and later retrieving it out of memory creates unnecessary delay, even not to significant.

2) Code complexity. The current implementation is much cleaner since it doesn't have to store objects in the session or request in servlet in order to retrieve it later. It also has the advantage of retrieving data when and how we need 'em.

The downside of retrieving data in servlets is: If there are several ways to get to the same page, all the servlets redirecting to that page should update page data, isn't it? Then the code updating the data should be duplicated in these servlets.

--
Alexey Parshin,
http://www.sptk.net

Authoright © Total Knowledge: 2001-2008