Skip to main content
added 11 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21

For the first time I'm starting to think either can be true. Both interfaces are really owned by the red inner layer. Rather than ownership of interfaces happening vertically or horizontally here it's happening diagonally. At least until you rotate around the "mechanism Layer" to get back to the clean architecture UML. Then ownership is verticaldiagonally*.

* At least until you rotate around the "mechanism Layer" to get back to the clean architecture UML. Then ownership is vertical.

For the first time I'm starting to think either can be true. Both interfaces are really owned by the red inner layer. Rather than ownership of interfaces happening vertically or horizontally here it's happening diagonally. At least until you rotate around the "mechanism Layer" to get back to the clean architecture UML. Then ownership is vertical.

For the first time I'm starting to think either can be true. Both interfaces are really owned by the red inner layer. Rather than ownership of interfaces happening vertically or horizontally here it's happening diagonally*.

* At least until you rotate around the "mechanism Layer" to get back to the clean architecture UML. Then ownership is vertical.

added 2 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21

You can call it ports and adapters or hexagonal architecture. Regardless, what's facinated me about this picturethis picture isn't the layers. It's the Clean Architecture UML diagram over in the corner of a plugin that looks like an upside down, folded over version of the Dependency Inversion Principle:

You can call it ports and adapters or hexagonal architecture. Regardless, what's facinated me about this picture isn't the layers. It's the Clean Architecture UML diagram over in the corner of a plugin that looks like an upside down, folded over version of the Dependency Inversion Principle:

You can call it ports and adapters or hexagonal architecture. Regardless, what's facinated me about this picture isn't the layers. It's the Clean Architecture UML diagram over in the corner of a plugin that looks like an upside down, folded over version of the Dependency Inversion Principle:

added 30 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
package candiedOrange.plugin; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestUseCases { public static class PushMock implements ButtonUseCaseInputPort, ButtonUseCaseOutputPort { boolean pushed; public boolean isPushed() { return pushed; } public void push() { this.pushed = true; } } @Test public void testInteractor() { PushMock presentorMock = new PushMock(); assertFalse( presentorMock.isPushed() ); new ButtonPushUseCaseInteractor(presentorMock).push(); assertTrue( presentorMock.isPushed() ); } } 
 package candiedOrange.plugin; import candiedOrange.plugin.adapters.ButtonControler; import candiedOrange.plugin.adapters.ButtonPresenter; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestAdapters { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private PrintStream oldStdOut; @Before public void setUpStreams() { oldStdOut = System.out; System.setOut( new PrintStream(outContent) ); } @After public void cleanUpStreams() { System.setOut(oldStdOut); } @Test public void testOut() { System.out.print("hello"); assertEquals( "hello", outContent.toString() ); } @Test public void testPresenter() { outContent.reset(); new ButtonPresenter().push(); assertEquals( "push", outContent.toString() ); } @Test public void testControler() { TestUseCases.PushMock interactorMock = new TestUseCases.PushMock(); assertFalse( interactorMock.isPushed() ); new ButtonControler(interactorMock).push(); assertTrue( interactorMock.isPushed() ); } @Test public void testEndToEnd() { outContent.reset(); new ButtonControler( new ButtonPushUseCaseInteractor( new ButtonPresenter() ) ).push(); assertEquals( "push", outContent.toString() ); } } 
package candiedOrange.plugin; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestUseCases { public static class PushMock implements ButtonUseCaseInputPort, ButtonUseCaseOutputPort { boolean pushed; public boolean isPushed() { return pushed; } public void push() { this.pushed = true; } } @Test public void testInteractor() { PushMock presentorMock = new PushMock(); assertFalse(presentorMock.isPushed()); new ButtonPushUseCaseInteractor(presentorMock).push(); assertTrue(presentorMock.isPushed()); } } 
 package candiedOrange.plugin; import candiedOrange.plugin.adapters.ButtonControler; import candiedOrange.plugin.adapters.ButtonPresenter; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestAdapters { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private PrintStream oldStdOut; @Before public void setUpStreams() { oldStdOut = System.out; System.setOut(new PrintStream(outContent)); } @After public void cleanUpStreams() { System.setOut(oldStdOut); } @Test public void testOut() { System.out.print("hello"); assertEquals("hello", outContent.toString()); } @Test public void testPresenter() { outContent.reset(); new ButtonPresenter().push(); assertEquals("push", outContent.toString()); } @Test public void testControler() { TestUseCases.PushMock interactorMock = new TestUseCases.PushMock(); assertFalse(interactorMock.isPushed()); new ButtonControler(interactorMock).push(); assertTrue(interactorMock.isPushed()); } @Test public void testEndToEnd() { outContent.reset(); new ButtonControler(new ButtonPushUseCaseInteractor(new ButtonPresenter())).push(); assertEquals("push", outContent.toString()); } } 
package candiedOrange.plugin; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestUseCases { public static class PushMock implements ButtonUseCaseInputPort, ButtonUseCaseOutputPort { boolean pushed; public boolean isPushed() { return pushed; } public void push() { this.pushed = true; } } @Test public void testInteractor() { PushMock presentorMock = new PushMock(); assertFalse( presentorMock.isPushed() ); new ButtonPushUseCaseInteractor(presentorMock).push(); assertTrue( presentorMock.isPushed() ); } } 
 package candiedOrange.plugin; import candiedOrange.plugin.adapters.ButtonControler; import candiedOrange.plugin.adapters.ButtonPresenter; import candiedOrange.plugin.usecases.ButtonPushUseCaseInteractor; import candiedOrange.plugin.usecases.ButtonUseCaseInputPort; import candiedOrange.plugin.usecases.ButtonUseCaseOutputPort; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class TestAdapters { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private PrintStream oldStdOut; @Before public void setUpStreams() { oldStdOut = System.out; System.setOut( new PrintStream(outContent) ); } @After public void cleanUpStreams() { System.setOut(oldStdOut); } @Test public void testOut() { System.out.print("hello"); assertEquals( "hello", outContent.toString() ); } @Test public void testPresenter() { outContent.reset(); new ButtonPresenter().push(); assertEquals( "push", outContent.toString() ); } @Test public void testControler() { TestUseCases.PushMock interactorMock = new TestUseCases.PushMock(); assertFalse( interactorMock.isPushed() ); new ButtonControler(interactorMock).push(); assertTrue( interactorMock.isPushed() ); } @Test public void testEndToEnd() { outContent.reset(); new ButtonControler( new ButtonPushUseCaseInteractor( new ButtonPresenter() ) ).push(); assertEquals( "push", outContent.toString() ); } } 
added 30 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
deleted 1 character in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 17 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
edited body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 322 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 51 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 51 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 51 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
adding color
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 2 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 14 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
added 936 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
deleted 32 characters in body; edited title; edited title
Source Link
200_success
  • 145.7k
  • 22
  • 191
  • 481
Loading
added 105 characters in body
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading
Source Link
candied_orange
  • 842
  • 1
  • 7
  • 21
Loading