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 [polymorphism]

Ask Question

Polymorphism is about using objects of a type uniformly, regardless of their subtype.

206 questions
Filter by
Sorted by
Tagged with
0votes
2answers
144views

I'll get straight to the point. I want to implement a class structure in Java similar to the one in the image.Am I falling into bad practice with this kind of diamond-shaped interface implementation?...
A. WW's user avatar
4votes
1answer
254views

Let's say I'm making a space 4X game (because I am!) and I have an ISpaceObject interface in my domain layer, with a number of classes such as Ship, Starbase, Planet, Wormhole, etc. implementing it. I ...
5votes
5answers
977views

I'm designing a system with different types of components, and I'm trying to decide whether to use polymorphism or instanceof checks for handling type-specific behavior.I see two possible approaches:...
user avatar
7votes
8answers
945views

According to Is it wrong to use a boolean parameter to determine behavior?, I know using boolean parameters to decide the behaviour is bad, for example, when using boolean parameters as the following:...
1vote
7answers
538views

In my multiplayer game I keep track of each player's inventory. I have a class for each inventory action that extends the abstract class InventoryItem. I then polymorphically call use() on the ...
2votes
0answers
81views

What to do if you end up in the following situationThe intent here is that b and c can be substitutable for a. The client creates a bar through foo_1, which later may be passed back to foo_1 through ...
user877329's user avatar
-2votes
2answers
362views

I'm in the process of writing a library in Python, and I've run into a design problem concerning the use of polymorphism.I have an ABC with abstract method 'foo':class A(ABC): @abstractmethod ...
2votes
3answers
976views

I know there are already some questions about replacing if else with polymorphism, for example:Applying Replace Conditional with Composition in functional programmingIs it wrong to use any type of ...
2votes
3answers
325views

A scenario often arises when attempting to make some existing code reusable. I introduce an interface to represent the commonality between some new feature I'm implementing and some existing ...
amarsha4's user avatar
2votes
1answer
714views

When talking about having a rich domain model successfully, in real applications, it needs to, somehow, access some abstraction of complex functionality (instead of being a row state calculator the ...
3votes
1answer
398views

I have read this article which indicates a double tuple structure, but it is unfortunately light on implementation details, which is what I am looking for.So... how are interfaces implemented in Go?...
0votes
0answers
589views

Because I have multiple entities with unique fields, I need multiple repositories for each one even though each Entity will be handled exactly the same. What is the best way to handle these separate ...
-1votes
1answer
347views

Let's assume we need to send a message, and to do so we would like our client to be concerned only with constructing the message (DTO) and using a facade service to send it.We already know that we ...
0votes
1answer
203views

I am making a game of Monopoly. I call a method in my Board class which returns the current players square object! E.g Old Kent Road. Euston, Chance , Free parking. I use polymorphism to decide upon ...
Kevin Greetham's user avatar
2votes
3answers
333views

I am running into a conflict between two best practice principles-overloading should be used instead of long chained if/else statementsmodels should not contain business logicI am working on a ...

153050per page
1
2345
14

Hot Network Questions

more hot questions
Newest polymorphism questions feed

[8]ページ先頭

©2009-2025 Movatter.jp