Skip to main content
Commonmark migration
Source Link

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag

 

getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag

 

getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

Breaking this up so people may vote on the ideas seperately
Source Link
candied_orange
  • 120k
  • 27
  • 233
  • 370

First of all, thank you for not calling it IBugTag. When I'm using it in BugReport it's nice not to even know that I'm talking to an interface.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

However, both of these designs violate: Tell, don't ask.

It may be too late. The rest of your design, or your mind set, might be demanding the ask way of doing things. If not, consider a world where you don't ask BugTag what's going on at all. You tell it when it's time to do it's thing.

BugTag


display(): void

This way, BugTag is a behavior object not a data object (like String). It will still hold data but the data will be encapsulated so no other objects need to know about it. You will need to pass BugTag something to talk to when it displays. But you really shouldn't feel like you are obligated to return any data to anybody. This is your data. Guard it jealously.

First of all, thank you for not calling it IBugTag. When I'm using it in BugReport it's nice not to even know that I'm talking to an interface.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

However, both of these designs violate: Tell, don't ask.

It may be too late. The rest of your design, or your mind set, might be demanding the ask way of doing things. If not, consider a world where you don't ask BugTag what's going on at all. You tell it when it's time to do it's thing.

BugTag


display(): void

This way, BugTag is a behavior object not a data object (like String). It will still hold data but the data will be encapsulated so no other objects need to know about it. You will need to pass BugTag something to talk to when it displays. But you really shouldn't feel like you are obligated to return any data to anybody. This is your data. Guard it jealously.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

added 27 characters in body
Source Link
candied_orange
  • 120k
  • 27
  • 233
  • 370

First of all, thank you for not calling it IBugTag. When I'm using it in BugReport it's nice not to even know that I'm talking to an interface.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. TheHaving getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

However, both of these designs violate: Tell, don't ask.

It may be too late. The rest of your design, or your mind set, might be demanding the ask way of doing things. If not, consider a world where you don't ask BugTag what's going on at all. You tell it when it's time to do it's thing.

BugTag


display(): void

This way, BugTag is a behavior object not a data object (like String). It will still hold data but the data will be encapsulated so no other objects need to know about it. You will need to pass BugTag something to talk to when it displays. But you really shouldn't feel like you are obligated to return any data to anybody. This is your data. Guard it jealously.

First of all, thank you for not calling it IBugTag. When I'm using it in BugReport it's nice not to even know that I'm talking to an interface.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. The BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

However, both of these designs violate: Tell, don't ask.

It may be too late. The rest of your design, or your mind set, might be demanding the ask way of doing things. If not, consider a world where you don't ask BugTag what's going on at all. You tell it when it's time to do it's thing.

BugTag


display(): void

This way, BugTag is a behavior object not a data object (like String). It will still hold data but the data will be encapsulated so no other objects need to know about it. You will need to pass BugTag something to talk to when it displays. But you really shouldn't feel like you are obligated to return any data to anybody. This is your data. Guard it jealously.

First of all, thank you for not calling it IBugTag. When I'm using it in BugReport it's nice not to even know that I'm talking to an interface.

The BugTag interface shouldn't even know Duplicate exists. In design 2 it doesn't know. It doesn't want to know. This is good. Having getDuplicate() in the BugTag in Design 1 creates a violation of the open/closed principle waiting to happen.

How, then, do you create a navigable link from one BugReport to another? Well, you do it like design 1. You just call it something that doesn't imply Duplicate exists.

BugTag


getLinkedBugReport(): BugReport
inspectState(): String

Now you have a design that won't break if later you have to add a Working BugTag or even a Revisiting BugTag that links to a BugReport.

However, both of these designs violate: Tell, don't ask.

It may be too late. The rest of your design, or your mind set, might be demanding the ask way of doing things. If not, consider a world where you don't ask BugTag what's going on at all. You tell it when it's time to do it's thing.

BugTag


display(): void

This way, BugTag is a behavior object not a data object (like String). It will still hold data but the data will be encapsulated so no other objects need to know about it. You will need to pass BugTag something to talk to when it displays. But you really shouldn't feel like you are obligated to return any data to anybody. This is your data. Guard it jealously.

Source Link
candied_orange
  • 120k
  • 27
  • 233
  • 370
Loading