<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OOP – Object-Oriented Programming on kodkod | Intro Course</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/</link><description>Recent content in OOP – Object-Oriented Programming on kodkod | Intro Course</description><generator>Hugo</generator><language>en</language><copyright>מבואות קודקוד</copyright><atom:link href="https://intro-kodkod-6.nm-ambition.com/en/docs/oop/index.xml" rel="self" type="application/rss+xml"/><item><title>Classes and Objects: From the Problem to a Complete Class</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/01-classes-and-objects/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/01-classes-and-objects/</guid><description>&lt;h2 id="in-this-lesson"&gt;In this lesson&lt;/h2&gt;
&lt;p&gt;This lesson is built as one story, in the same order as the slides. We start from a small bank system written with dictionaries and functions, see where it breaks, and in every chapter add one tool that solves one problem:&lt;/p&gt;</description></item><item><title>Objects at Work: State, Information Hiding, Properties and a Complete Class</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/02-objects-in-practice/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/02-objects-in-practice/</guid><description>&lt;h2 id="in-this-lesson"&gt;In this lesson&lt;/h2&gt;
&lt;p&gt;This lesson is built as one story, in the same order as the slides. Every chapter relies on the previous one:&lt;/p&gt;</description></item><item><title>Inheritance and super: Similar Classes Without Duplicated Code</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/03-inheritance/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/03-inheritance/</guid><description>&lt;h2 id="in-this-lesson"&gt;In this lesson&lt;/h2&gt;
&lt;p&gt;This lesson is built as one story, in the same order as the slides:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Chapter 1&lt;/strong&gt; — why inheritance: the same code twice, and how to inherit instead of copying&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chapter 2&lt;/strong&gt; — overriding and &lt;code&gt;super()&lt;/code&gt;: inheritance, but not exactly — changing only part of the behavior&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At the end of the lesson — practice, and a &lt;strong&gt;mini project&lt;/strong&gt; that connects both chapters.&lt;/p&gt;</description></item><item><title>Polymorphism: a Common Interface, Different Behavior</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/04-polymorphism/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/04-polymorphism/</guid><description>&lt;h2 id="what-will-we-learn"&gt;What will we learn?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;Polymorphism&lt;/strong&gt; is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A Common Interface&lt;/strong&gt;: the same method, different behavior for each type.&lt;/li&gt;
&lt;li&gt;Why it &lt;strong&gt;replaces&lt;/strong&gt; the &lt;code&gt;if type == ...&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Duck Typing&lt;/strong&gt;: Python&amp;rsquo;s flexible version.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="why-do-we-need-this"&gt;Why do we need this?&lt;/h2&gt;
&lt;p&gt;Suppose a payment system needs to charge a customer, and the customer can pay by credit card, by PayPal or by bank transfer. Without Polymorphism:&lt;/p&gt;</description></item><item><title>Single Responsibility in OOP and Composition Versus Inheritance</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/05-srp-and-composition/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/05-srp-and-composition/</guid><description>&lt;h2 id="what-will-we-learn"&gt;What will we learn?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Single Responsibility Principle (SRP)&lt;/strong&gt; at the level of a Class.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Composition&lt;/strong&gt;: an object made of other objects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Composition versus Inheritance&lt;/strong&gt;: how to choose.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="why-do-we-need-this"&gt;Why do we need this?&lt;/h2&gt;
&lt;p&gt;In the clean code topic we learned SRP for &lt;strong&gt;functions&lt;/strong&gt;: every function does one thing. Exactly the same principle applies to &lt;strong&gt;Classes&lt;/strong&gt;, and there it is even more important, because a big Class is a &amp;ldquo;pile&amp;rdquo; of data &lt;strong&gt;and&lt;/strong&gt; behavior. When every change (in the receipt format, in the payment method, in the VAT calculation) touches the same Class, it becomes fragile and scary to change.&lt;/p&gt;</description></item><item><title>Guided Practice: From a Verbal Requirement to a Class Structure</title><link>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/06-from-requirements-to-classes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://intro-kodkod-6.nm-ambition.com/en/docs/oop/06-from-requirements-to-classes/</guid><description>&lt;h2 id="what-will-we-learn"&gt;What will we learn?&lt;/h2&gt;
&lt;p&gt;This is a &lt;strong&gt;workshop&lt;/strong&gt; lesson. We will take one verbal requirement, and go &lt;strong&gt;together&lt;/strong&gt; through the whole process:&lt;/p&gt;</description></item></channel></rss>