<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-932581696288882474</id><updated>2010-03-20T15:02:48.958-07:00</updated><title type='text'>dev Notes</title><subtitle type='html'>developer sticky notes - trivia, arguments and recipes</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-8995476025175278359</id><published>2008-06-06T05:59:00.000-07:00</published><updated>2008-06-06T06:41:18.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='recipes'/><title type='text'>Reference to a Method in PHP - Delegation Pattern</title><content type='html'>I've been just looking for possiblity to pass method by reference in PHP. Why ? Well, it is possible in Python where everything is an object.And it is sometimes really useful. Imagine that You want to call some particular specific method within some more general object. Imagine that the state of the general one depends on the results of this method. But as I said, implementation of this method may be different for different objects. It is sort of &lt;a href="http://en.wikipedia.org/wiki/Delegation_pattern" title="Delegation Pattern" target="_blank"&gt;Delegation Pattern&lt;/a&gt; where responsibility of implementation certain behaviour is being delegated to some other object.&lt;br /&gt;Of course it is possible to pass a name of a function as a string and or c&lt;a href="http://php.net/manual/en/function.call-user-func.php" title="Call User Function" target="_blank"&gt;alling user function&lt;/a&gt;. But this is not I was looking for.&lt;br /&gt;And again I found usefulness of &lt;A href="http://pl.php.net/oop5.magic" title="magic methods in PHP" target="_blank"&gt;magic methods in PHP&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class A{&lt;br /&gt;   public function say($word){&lt;br /&gt;      print $word;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class B{&lt;br /&gt;   /**&lt;br /&gt;    * try of calling not existing method on object B&lt;br /&gt;    * will execute the magic method&lt;br /&gt;    */&lt;br /&gt;   __call($m,$a){&lt;br /&gt;      return $a[0]()-&gt;$m($a[1]);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;$a = new A;&lt;br /&gt;$B = new B;&lt;br /&gt;// actually I pass object reference&lt;br /&gt;$B-&gt;say($a,"Hallo");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Nice ? :) Quite... Of course body of magic &lt;i&gt;__call&lt;/i&gt; method could be more sophisticated and more general. But this is just for testing of the behaviour that I was looking for. Anyway, I have  found such sophisticated &lt;a href="http://phpimpact.wordpress.com/2007/11/12/implementing-the-delegation-pattern-using-reflection/" target="_blank" title="Implementing the Delegation Pattern Using Reflection"&gt;implementation using Reflection&lt;/a&gt;. However my apache is always blowing out while trying to call that code :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-8995476025175278359?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/8995476025175278359/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=8995476025175278359' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/8995476025175278359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/8995476025175278359'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/06/reference-to-method-in-php-delegation.html' title='Reference to a Method in PHP - Delegation Pattern'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-8970891338572317206</id><published>2008-03-18T07:03:00.000-07:00</published><updated>2008-03-18T07:20:39.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><category scheme='http://www.blogger.com/atom/ns#' term='recipes'/><title type='text'>Problems with Floating-Point Comparisons</title><content type='html'>I like to repeat that man learns at every step. And this is what I've learned while writing unit test. I have wanted to retrieve the record from database that I have just inserted there. The value that I have been looking for has been type of float. What was my surprise when the query returned me  empty sets but retrieving all records I have seen that value there...&lt;br /&gt;&lt;br /&gt;This is general known float numbers issue. The solution is simple. You have to define the tolerance that is acceptable for You and while trying to get particular value write the where clause using range like that:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT * FROM CUSTOMER WHERE budget&gt;1224.56-0.0001 AND budget&lt;1224.56+0.0001&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You may find more about the issue on &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html" target="_blank"&gt;Problems with Floating-Point Comparisons&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-8970891338572317206?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/8970891338572317206/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=8970891338572317206' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/8970891338572317206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/8970891338572317206'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/03/problems-with-floating-point.html' title='Problems with Floating-Point Comparisons'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-928054904354222237</id><published>2008-03-07T03:46:00.000-08:00</published><updated>2008-03-07T04:20:10.425-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PhpClasses'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='recipes'/><title type='text'>Transliterator for UTF-8 text to Latin</title><content type='html'>I was looking for solution to change UTF-8 encoded text with national characters to latin equivalents. It would be useful while generating for instance url to post depending on blog post title. I saw that some services use it. (Strange but not blogger) And i wanted to have some global, multi language solution...&lt;br /&gt;&lt;br /&gt;And here it is &lt;a href="http://www.phpclasses.org/browse/package/4430.html" title="PrettyLatin" target="_blank"&gt;PrettyLatin&lt;/a&gt; - my contribution to &lt;a href="http://www.phpclasses.org" title="php classes" target="_blank"&gt;PhpClasses&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;So how it works - You call one method with UTF-8 encoded string and got returned text with removed diacritic characters. Pretty simple :)&lt;br /&gt;&lt;br /&gt;For now it only fully supports russian characters and polish ones. (plus some other).&lt;br /&gt;&lt;br /&gt;There are two possible way of class development:&lt;br /&gt;- we can define new entity names so called friendly codes that are missing right now in &lt;a href="http://webdesign.about.com/library/bl_htmlcodes.htm" title="HTML special characters codes" target="_blank"&gt;HTML table&lt;/a&gt; (in that way maybe in future we will cover all of them :) ) for example:&lt;br /&gt;280 = "Eogonek" (&amp;#280;=&gt;&amp;amp;#280;=&gt;&amp;Eogonek; which gives latin E)&lt;br /&gt;321 = "Lbar" (&amp;#321;=&gt;&amp;amp;#321;=&gt;&amp;Lbar; which gives latin L)&lt;br /&gt;1071 = "YAcyr"(&amp;#1071;=&gt;&amp;amp;#1071;=&gt;&amp;YAcyr; which gives latin YA)&lt;br /&gt;like &lt;a href="http://www.faqs.org/docs/docbook/html/ref-charents.html" title="html entity names"&gt;here&lt;/a&gt;.This is especially helpful for not latin base alphabets like russian cyrillic...&lt;br /&gt;- or we can map codes of national character to latin equivalent...&lt;br /&gt;&lt;br /&gt;Feel free to comment and improve my code and pls notify me about newer, more complete version...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-928054904354222237?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/928054904354222237/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=928054904354222237' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/928054904354222237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/928054904354222237'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/03/transliterator-for-utf-8-text-to-latin.html' title='Transliterator for UTF-8 text to Latin'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-1354989709879686075</id><published>2008-02-25T05:03:00.000-08:00</published><updated>2008-02-25T06:16:36.595-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming paradigm'/><category scheme='http://www.blogger.com/atom/ns#' term='arguments'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><category scheme='http://www.blogger.com/atom/ns#' term='high-level abstractions'/><title type='text'>on Events abstract approach</title><content type='html'>I have already met the events on my programming way. It was event based &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;MVC&lt;/a&gt; framework - Mach-II. The approach is quite nice, and is applicable especially to &lt;a href="http://en.wikipedia.org/wiki/Graphical_user_interface"&gt;GUI&lt;/a&gt; designing. However it's usage is much more wider. Anyway, I've decided for myself to make it finally clear, and set the concepts in proper order according to the abstraction of the idea...&lt;br /&gt;&lt;br /&gt;So the clue of &lt;a href="http://en.wikipedia.org/wiki/Event-driven_programming"&gt;event-driven programming&lt;/a&gt; or event-based approach is event as the name says. But what the hell the &lt;a href="http://en.wikipedia.org/wiki/Event_%28computing%29"&gt;event&lt;/a&gt; is ? :) I've already heard that someone codes the event or call it. Personally I find an event as &lt;span style="font-weight:bold;"&gt;signal&lt;/span&gt; that the action should be taken on. Such signal is actually being &lt;span style="font-weight:bold;"&gt;announced&lt;/span&gt; to the &lt;span style="font-weight:bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Event_handler"&gt;event handler&lt;/a&gt;&lt;/span&gt;. Event handler listens to the events that &lt;span style="font-weight:bold;"&gt;registered interests&lt;/span&gt; in and takes proper action. Of course there is an events model needed that helps with all that - understand the signal (variable, object, reference to a method) as the event, allows to register and handle it... &lt;br /&gt;&lt;br /&gt;Good enough for now to use it as argument and to speak one language... Will be back to it with implementation of events in Python, Observer Pattern, and AOP ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-1354989709879686075?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/1354989709879686075/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=1354989709879686075' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/1354989709879686075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/1354989709879686075'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/02/on-events-abstract-approach.html' title='on Events abstract approach'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-4483320344349775013</id><published>2008-02-14T13:47:00.000-08:00</published><updated>2008-02-14T14:16:27.845-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Agile Development'/><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><title type='text'>Lesson Learned (from the agile development)</title><content type='html'>Man learns on each step. And the agile methods help to walk that way...&lt;br /&gt;&lt;br /&gt;We are just applying these methods in my company and I moved here just three months ago. You can understand then my enthusiasm ;) This is really active time for me. I'm again pushed to use my mind which I missed not so long time ago. I'm surprised when looking at my watch and finding out that 5 pm has just arrived :) It is difficult for me to keep up blogging while so intensive days :)&lt;br /&gt;&lt;br /&gt;So I will note here just few things I've learned according to agile development methods itself. Later hope to find time to write about things I've learned as programmer...&lt;br /&gt;&lt;br /&gt;1 - it is really important to start implementing tasks with unit tests and after that to implement concrete methods&lt;br /&gt;2 - unit tests should be really detailed ones not to miss any tarantula&lt;br /&gt;3 - if requirement is related to the research on some issue then some bigger time buffer should be set for it (if we solve it faster we can still add some task to the requirement otherwise we can have to much opened tasks on the end of iteration)&lt;br /&gt;4 - while number of iteration is increasing within a project, integration tests are more and more meaningful so the estimations should be done accordingly ...&lt;br /&gt;&lt;br /&gt;that's all for now :)&lt;br /&gt;&lt;br /&gt;cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-4483320344349775013?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/4483320344349775013/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=4483320344349775013' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/4483320344349775013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/4483320344349775013'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/02/lesson-learned-from-agile-development.html' title='Lesson Learned (from the agile development)'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-5204398806056937033</id><published>2008-01-03T16:52:00.000-08:00</published><updated>2008-01-04T09:06:27.218-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='recipes'/><title type='text'>Class Properties Implementation - accessors and nested functions in Python</title><content type='html'>This is really quite nice in Python how You can define getters and setters (if You need them) for properties of a class ( actually in Python 2.2+ meaning &lt;a href="http://www.geocities.com/foetsch/python/new_style_classes.htm" target="_blank" title="New Style Class in Python"&gt;new style classes&lt;/a&gt; ). There when the class derives from &lt;span style="font-style:italic;"&gt;object&lt;/span&gt; then You can use built-in function &lt;span style="font-style:italic;"&gt;&lt;a href="http://docs.python.org/lib/built-in-funcs.html#l2h-57" target="_blank" title="property()"&gt;property()&lt;/a&gt;&lt;/span&gt;. The one gets as arguments accessors methods accordingly &lt;span style="font-style:italic;"&gt;fget&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;fset&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;fdel&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;doc&lt;/span&gt; as getter, setter, function for del'ing, and the &lt;a href="http://epydoc.sourceforge.net/docstrings.html" target="_blank" title="Python Docstring"&gt;docstring&lt;/a&gt; (let say a comment used for documentation) of the property attribute. &lt;br /&gt;So we can create class property as an instance of &lt;span style="font-style:italic;"&gt;property()&lt;/span&gt; like that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Foo(object):&lt;br /&gt;   def __init__(self):&lt;br /&gt;    pass&lt;br /&gt;&lt;br /&gt;  def get_bar(self):&lt;br /&gt;    return self._bar&lt;br /&gt;  def set_bar(self, value):&lt;br /&gt;    self._bar = value&lt;br /&gt;  def del_bar(self): &lt;br /&gt;    del self._bar&lt;br /&gt;  bar = property(get_bar, set_bar, del_bar, &lt;span style="font-style:italic; color:green"&gt;"I'm bar property."&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;foo = Foo()&lt;br /&gt;foo.bar = 'bar'&lt;br /&gt;print foo.bar&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This way is good either if You want to define visibility scope for attribute. Then, for example for protected attribute, You would not define setter method and not pass it to &lt;span style="font-style:italic;"&gt;property()&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;As can be seen above, there is no more a need to call the helper methods for accessors directly. So why not to hide them and clean the name space. Here comes a tricky part :) with nice &lt;span style="font-weight:bold;"&gt;nested methods&lt;/span&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Foo(object):&lt;br /&gt;  def __init__(self):&lt;br /&gt;    pass&lt;br /&gt;  &lt;br /&gt;  def bar():&lt;br /&gt;    def fget(self)&lt;br /&gt;      return self._bar&lt;br /&gt;    def fset(self,value)&lt;br /&gt;      self._bar = value&lt;br /&gt;    return locals()&lt;br /&gt;  bar = property(**bar())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Built-in dictionary of &lt;a href="http://docs.python.org/lib/built-in-funcs.html#l2h-47" title="locals()" target="_blank"&gt;locals&lt;/a&gt; returned from bar() is being projected onto named arguments of property. Values of dictionary are tied with instance of property. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To &lt;a href="http://www.wellho.net/solutions/python-python-list-python-tuple-python-dictionary.html" title="tuple vs dictionary" target="_blank"&gt;tuple&lt;/a&gt; or not to tuple&lt;/span&gt;&lt;br /&gt;This is the question I asked myself after had found out that the above example will only work, when there is no any other local variable defined in a function ,that would be returned by &lt;span style="font-style:italic;"&gt;locals()&lt;/span&gt; additional and wouldn't match arguments of &lt;span style="font-style:italic;"&gt;property()&lt;/span&gt;. This is what You can do in such case - create property using tuple like that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    return fget, fset&lt;br /&gt;  bar = property(*bar())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Well, to be honest, most probably I would use a tuple as a &lt;a href="http://en.wikipedia.org/wiki/Immutable_object" title="immutable object" target="_blank"&gt;immutable object&lt;/a&gt; - ordered list of constants defined &lt;span style="font-style:italic;"&gt;explicite&lt;/span&gt;... meaning - if You put there something, You know it is there... yeah, can't be more clear ;)&lt;br /&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-5204398806056937033?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/5204398806056937033/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=5204398806056937033' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/5204398806056937033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/5204398806056937033'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/01/class-properties-implementation.html' title='Class Properties Implementation - accessors and nested functions in Python'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932581696288882474.post-1217356978328989664</id><published>2008-01-02T01:07:00.000-08:00</published><updated>2008-01-02T05:05:51.468-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trivia'/><category scheme='http://www.blogger.com/atom/ns#' term='ORM'/><title type='text'>ORM does not like multiple primary keys</title><content type='html'>This is the first thing I've learned just at the very beginning of getting to know &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping" title="Object Relational Mapping" target="_blank"&gt;Object Relational Mapping&lt;/a&gt;. ORM Systems does not like multiple primary keys. Primary keys on several columns should be replaced by one unique PK. This sounds trivial while revealed to me. Finally this is about objects' relations but not database tables. And them, the objects, should be uniquely identified. The main, most important and the hardest thing at the beginning is to change thinking from &lt;a href="http://en.wikipedia.org/wiki/RDBM" title="RDBMS" target="_blank"&gt;RDBMS&lt;/a&gt; to &lt;a href="http://en.wikipedia.org/wiki/Object-relational_database" title="object relational database" target="_blank"&gt;ORD&lt;/a&gt; (ORMS). Object is the point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/932581696288882474-1217356978328989664?l=devnotelog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://devnotelog.blogspot.com/feeds/1217356978328989664/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=932581696288882474&amp;postID=1217356978328989664' title='Komentarze (1)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/1217356978328989664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932581696288882474/posts/default/1217356978328989664'/><link rel='alternate' type='text/html' href='http://devnotelog.blogspot.com/2008/01/orm-does-not-like-multiple-primary-keys.html' title='ORM does not like multiple primary keys'/><author><name>ameros</name><uri>http://www.blogger.com/profile/18334681743394662250</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16655364805169593661'/></author><thr:total>1</thr:total></entry></feed>