are you suggesting this is nothing to worry about ?

in the case of Expenses app, there are only three entities: Expenses,
Reports, Employees
(and number of places and fine-grained activities mapper, is relative
to the number of entities)

however, in a larger app , there might be 50 entities.
and when using 4-5 ActivityMappers (for different display regions),
it will get difficult to manage.

#1 - One approach is checking all our 50 entities(or places) in one
giant if/else block.
(50 if/else statement)


#2- However, I believe we can group together our fine-grained
activities-mapper,
by using a base class for each group, and delegating the "instance of"
checks,
to a more specific activities mapper. this is better than using one
giant if/else in ActivityMapper,
but somehow these selections gets scattered.

My Concern is this:

I have read that frequent usage of "instance of" is a sign of code
smell.[*]
and also have read that if we have to resort to conditional instanceof
checks, it is better to keep it in one place
for the smell not getting spread !

the approach #2, delegating the "instanceof checks" to a more specific
mapper, will result in the code smell to spread.


and code inspection tools also flag these "instanceof", it gives the
impression of poor application design.
this is what I'm very worried about : (


[*]Java quality assurance by detecting code smells
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.80.2066&rep=rep1&type=pdf









-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to