{"id":6178,"date":"2014-11-26T14:59:54","date_gmt":"2014-11-26T06:59:54","guid":{"rendered":"http:\/\/onthe8spot.com\/?p=6178"},"modified":"2014-11-26T14:59:54","modified_gmt":"2014-11-26T06:59:54","slug":"how-to-use-groovy-traits","status":"publish","type":"post","link":"http:\/\/onthe8spot.com\/index.php\/2014\/11\/26\/how-to-use-groovy-traits\/","title":{"rendered":"How to use Groovy Traits"},"content":{"rendered":"<blockquote><p>Traits are reusable components basically set of methods or fields that you can make your class implement.<br \/>\n&nbsp;<br \/>\nWhy you should use them ?<br \/>\nYou must have heard of problems of multiple inheritence when working with java and also familiar with the well known situation of what is know as &#8216;Diamond problem&#8217;.It says that if you have two classes B and C inherit from A, and class D inherits from both B and C. If there is a method in A that B and\/or C has overridden, and D does not override it, then which version of the method does D inherit: that of B, or that of C ??<br \/>\nvia <a href=\"http:\/\/www.oodlestechnologies.com\/blogs\/How-to-use-Groovy-Traits\">How to use Groovy Traits<\/a>.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Traits are reusable components basically set of methods or fields that you can make your class implement. &nbsp; Why you should use them ? You must have heard of problems of multiple inheritence when working with java and also familiar with the well known situation of what is know as &#8216;Diamond problem&#8217;.It says that if &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/onthe8spot.com\/index.php\/2014\/11\/26\/how-to-use-groovy-traits\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to use Groovy Traits&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-6178","post","type-post","status-publish","format-standard","hentry","category-coding"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/posts\/6178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/comments?post=6178"}],"version-history":[{"count":0,"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/posts\/6178\/revisions"}],"wp:attachment":[{"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/media?parent=6178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/categories?post=6178"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/onthe8spot.com\/index.php\/wp-json\/wp\/v2\/tags?post=6178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}