pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin - collaborative debugging tool View Help


Posted by guilhermeblanco on Thu 20 Mar 18:19
report abuse | download | new post

  1. [15:05] <guilhermeblanco> romanb: one last question before I leave
  2. [15:06] <guilhermeblanco> CacheHandler actually handles the 2 types of cache in Query object
  3. [15:06] <guilhermeblanco> since now CacheHandler will return an instance of ParserResult in all situations...
  4. [15:07] <guilhermeblanco> how will it be the call to get the stored ResultSet (in the case that user decided to do a resultCache)?
  5. [15:07] <guilhermeblanco> following the strict API, it should be getSql()
  6. [15:07] <guilhermeblanco> since the equivalent to getData() will be getSql()
  7. [15:08] <guilhermeblanco> any suggestions?
  8. [15:11] <romanb> i think you're right. it does not seem so nice to have getData() in a ParserResult since it has nothing to do with it actually. need to think about it. im sure we'll find a good solution. this change (caching ParserResults) is definitely the right step.
  9. [15:12] <romanb> maybe we can have QueryResult that extends ParserResult and has $data and getData ? that just a really quick idea to get it separated
  10. [15:12] <romanb> may not be a good one
  11. [15:12] <guilhermeblanco> I can create an alias getData() { return $this->getSql(); } to make the API eye-candy...
  12. [15:12] <guilhermeblanco> OR
  13. [15:12] <guilhermeblanco> EXACTLY
  14. [15:12] <romanb> since the result cache is actually an extended version of the query cache
  15. [15:12] <romanb> literally
  16. [15:12] <guilhermeblanco> yeah
  17. [15:13] <guilhermeblanco> and then I can do:
  18. [15:13] <guilhermeblanco> QueryResult extends ParserResult { function getSql() {}  function getData() { return parent::getSql(); } }
  19. [15:13] <guilhermeblanco> OR
  20. [15:14] <guilhermeblanco> class ParserResult extends ResultAbstract {} class QueryResult extends ResultAbstract {}
  21. [15:14] <guilhermeblanco> which may be the best solution
  22. [15:15] <romanb> but its a matter of fact that the result cache stores all the information the query cache stores + the data
  23. [15:15] <romanb> or not? this sounds like direct inheritance for me
  24. [15:16] <guilhermeblanco> no... it stores either the SQL or the ResultSet... no both
  25. [15:16] <guilhermeblanco> *not
  26. [15:16] <romanb> ah ok right. it doesnt need the sql
  27. [15:16] <romanb> then thats better yes
  28. [15:16] <guilhermeblanco> ok... another pastebin... =)
  29. [15:16] <romanb> but AbstractResult instead of ResultAbstract
  30. [15:17] <romanb> actually... according to current coding standards
  31. [15:17] <romanb> Result_Abstract
  32. [15:17] <romanb> but we cant keep that anyway
  33. [15:17] <romanb> with namespaces we would go AbstractResult
  34. [15:17] <guilhermeblanco> I am imagining Result_Abstract, Result_ResulSet, Result_Parser
  35. [15:17] <romanb> in namespace Doctrine::Query
  36. [15:18] <guilhermeblanco> ok... I'd go with your suggestion... better than mine
  37. [15:19] <romanb> i'd prefer AbstractResult/ParserResult/QueryResult
  38. [15:19] <romanb> these names will survive namespaces, too
  39. [15:19] <romanb> the others wont

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me