Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities includingStack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Loading…
Software Engineering

Questions tagged [liskov-substitution]

Ask Question

For questions about Liskov substitution principle in object-oriented design.

103 questions
Filter by
Sorted by
Tagged with
7votes
3answers
550views

The Java List<E> interface includes methods, such as add(E) and remove(Object), that work as the names suggest on instances of mutable concrete implementations, such as ArrayList<E> and ...
2votes
1answer
200views

I have an interface defined as follows:interface MyInterface{ public function setMyMethod(int $a); public function getMyMethod(): int;}And I have a class that widens the parameter type:...
5votes
7answers
586views

Consider the following scenario.I have an interface IService:public interface IService{ void DoSomething();}with an implementation:public class Implementation : IService{ // This might ...
1vote
3answers
269views

According to Invariant rule in Liskov Substitution Principle, I know one of the form of violation of "Liskov Substitution Principle" is violating "invariants can't be weakened in a ...
2votes
4answers
316views

For example, I have a Label class where the default font color is black:public class MyLabel{ protected int r=0; protected int g=0; protected int b=0; public void setRGB(int r,int g,...
wcminipgasker2023's user avatar
1vote
1answer
149views

Say we have the interfaceinterface IColoredSquare{ int GetSideLength(); void SetSideLength(int length); string GetColor();}and I implement it like thisclass ColoredSquare : ...
user avatar
3votes
2answers
417views

From Liskov Substitution Principle, I am still not very clear about the invariant rule. I read through many posts but I still have doubts.My example is picked from this blog, the example is slightly ...
riki's user avatar
  • 149
0votes
2answers
233views

Recently I read about ISP and wanted to implement it into my project. While implementing my design I think I found a flaw which violates LSP but I'm not sure.Given I have a game project, in which ...
2votes
2answers
456views

According to Is this a violation of the Liskov Substitution Principle?, as I understand, the top answer currently says the code below is violating "Liskov Substitution Principle":public ...
-1votes
2answers
268views

I thought I understood Liskov Substitution Principle but then I thought of a case and I wanted to ask the community here if I get it right.So I read somewhere to check if we have violated Liskov or ...
21votes
6answers
7kviews

In Python 3, I subclassed int to forbid the creation of negative integers:class PositiveInteger(int): def __new__(cls, value): if value <= 0: raise ValueError("value ...
2votes
3answers
681views

I have a doubt about what would be the right OOP approach for implementing classes that do similar stuff with different parameters.To provide a simple example, I would use two polynomial classes, ...
0votes
3answers
316views

I was reading about LSP (Liskov Substitution Principle) in a book called Clean Architecture: A Craftsman's Guide to Software Structure and Design. I have a question regarding how this would be ...
3votes
3answers
487views

I have read in an article DIP in the Wild that"When Robert Martin first discussed the DIP, he equated it a first-class combination of the Open Closed Principle and the Liskov Substitution ...
6votes
1answer
4kviews

I'm aware that there are 4 ways to violate Liskov Substitution from here.But I'm not sure what these violations would like in practice. Can you show examples of code that breaks the principle for ...
Alexis Winters's user avatar

153050per page
1
2345
7

Hot Network Questions

more hot questions
Newest liskov-substitution questions feed

[8]ページ先頭

©2009-2025 Movatter.jp