Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » NEW: Dispatcher (templateable dispatcher helper for MVC pattern and more)
Re: NEW: Dispatcher (templateable dispatcher helper for MVC pattern and more) [message #27382 is a reply to message #27368] Thu, 15 July 2010 12:24 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I'm struggling to understand why you're making it so complicated.

-If you are automatically unregistering Dispatchables on destruction you have no need to store Dispatchables in Ptr<>s and so can elliminate the overly complex PTEABLE branch.

-If you make DispatcherGen use Dispatcher objects internally (as I did) or even derive it from Dispatcher you can eliminate all of the complex Any stuff with sources. Keep it simple: Dispatcheables should only be registerable with Dispatchers and derived classes. Use the advantages of polymorphism.

-You don't need the source keys or the source key cache. If no key is specified by the caller to Unregister you can just iterate though the dests values looking for the correct pointer. This is potentially slightly slower, but if the developer is worried about performance then they should be using keys anyway.

-As I said before, do away with the NOMAP branch, the performance and memory usage gains are negligeable for the added code complexity. Having #defined branches through the code is really horrible, if you absolutely must have the branches then separate them completly or make them templated or something, currently it's extremely hard to read and understand the code.

Sorry, I don't want to seem too critical and my solution isn't the only way, but the whole thing just seems much more complicated (and thus diffcult to maintain and use) than it needs to be. Are you imagining some sort of use-case that I haven't considered?

[Updated on: Thu, 15 July 2010 13:23]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LED Ctrl (for characters and numbers)
Next Topic: Single Threaded RS232
Goto Forum:
  


Current Time: Fri Nov 01 01:37:32 CET 2024

Total time taken to generate the page: 0.02487 seconds