<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://jholjhapata.com/index.php?action=history&amp;feed=atom&amp;title=Interface_Segregation_Principle</id>
	<title>Interface Segregation Principle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://jholjhapata.com/index.php?action=history&amp;feed=atom&amp;title=Interface_Segregation_Principle"/>
	<link rel="alternate" type="text/html" href="https://jholjhapata.com/index.php?title=Interface_Segregation_Principle&amp;action=history"/>
	<updated>2026-05-17T04:27:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://jholjhapata.com/index.php?title=Interface_Segregation_Principle&amp;diff=37&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;The '''Interface Segregation Principle''' states that no client should be forced to depend on methods it does not use.  Do not add additional functionality to an existing inte...&quot;</title>
		<link rel="alternate" type="text/html" href="https://jholjhapata.com/index.php?title=Interface_Segregation_Principle&amp;diff=37&amp;oldid=prev"/>
		<updated>2019-08-15T15:36:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;Interface Segregation Principle&amp;#039;&amp;#039;&amp;#039; states that no client should be forced to depend on methods it does not use.  Do not add additional functionality to an existing inte...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The '''Interface Segregation Principle''' states that no client should be forced to depend on methods it does not use.&lt;br /&gt;
&lt;br /&gt;
Do not add additional functionality to an existing interface by adding new methods. Instead, create a new interface and let your class implement multiple interfaces if needed.&lt;br /&gt;
&lt;br /&gt;
== Interface Segregation Principle Example ==&lt;br /&gt;
Let’s take a look at an example of how to write a piece of code that violates this principle.&lt;br /&gt;
&lt;br /&gt;
    interface IPost&lt;br /&gt;
    {&lt;br /&gt;
        void CreatePost();&lt;br /&gt;
    }&lt;br /&gt;
    interface IPostNew&lt;br /&gt;
    {&lt;br /&gt;
        void CreatePost();&lt;br /&gt;
        void ReadPost();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
In this example, let’s pretend that I first created IPost interface with the signature of a CreatePost() method. Later on, I modify this interface by adding a new method ReadPost(), so it becomes like the IPostNew interface. This is where we violate the '''Interface Segregation Principle'''.&lt;br /&gt;
&lt;br /&gt;
Instead, simply create a new interface.&lt;br /&gt;
&lt;br /&gt;
    interface IPostCreate&lt;br /&gt;
    {&lt;br /&gt;
        void CreatePost();&lt;br /&gt;
    }&lt;br /&gt;
    interface IPostRead&lt;br /&gt;
    {&lt;br /&gt;
        void ReadPost();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
If any class might need both the CreatePost() method and the ReadPost() method, it will implement both interfaces.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>