logo
down
shadow

OOP QUESTIONS

When is OOP better suited for?
When is OOP better suited for?
I wish did fix the issue. There is no hard and fast rule. A problem is better solved with OOP when you are better at solving problems and thinking in an OO mentality. Object Orientation is just another tool which has come along through trying to make
TAG : oop
Date : January 23 2021, 02:43 AM , By : PsyberMonkey
What is Inversion of Control?
What is Inversion of Control?
help you fix your problem The Inversion of Control (IoC) and Dependency Injection (DI) patterns are all about removing dependencies from your code.For example, say your application has a text editor component and you want to provide spell checking. Y
TAG : oop
Date : January 22 2021, 02:12 PM , By : Matt Leacock
When writing a game, should you make objects/enemies/etc. have unique ID numbers?
When writing a game, should you make objects/enemies/etc. have unique ID numbers?
I think the issue was by ths following , One possible approach is to have objects register an interest with the object they're tracking. So the tracked object can inform the trackers of state changes dynamically. e.g. the Wolf registers with the Rabb
TAG : oop
Date : January 10 2021, 01:45 PM , By : Roel
What Is the Proper Way to Model a Discussion Forum Entity Relationship in OOP?
What Is the Proper Way to Model a Discussion Forum Entity Relationship in OOP?
Does that help I'm not the guru of OOP design but I guess the answer heavily depends on your app logic.I think first of all you have to consider your objects as an entity that keeps own internal data in consistency. E.g., if the Post does not need to
TAG : oop
Date : January 02 2021, 06:48 AM , By : Verbal
Which design is better? Put this logic in frontend or backend?
Which design is better? Put this logic in frontend or backend?
hop of those help? You should just have the atomic call like copy(source, target) in the API. The copy function itself should not be related to a specific directory. It’s use case is to copy, not to determine the target directory.
TAG : oop
Date : January 02 2021, 06:48 AM , By : Pradeep Gowda
MVVM pattern in NativeScript - how to use one?
MVVM pattern in NativeScript - how to use one?
I think the issue was by ths following , The answer is either of it should work. You may put the validation or tap function in view model or in the code behind file, it's upto you to decide which works best for you.If you put it in the view model, yo
TAG : oop
Date : January 02 2021, 06:48 AM , By : walshtp
How do I properly (idiomatically) do private members in dart?
How do I properly (idiomatically) do private members in dart?
it fixes the issue There is no "class private" in Dart, only "library private".The underlying design is based on the idea that a single library is one entity, created and edited by the same people with the same goals. You should not need to defend yo
TAG : oop
Date : January 02 2021, 06:48 AM , By : alexandruz
How to Combine Data From Different Bounded Context in DDD
How to Combine Data From Different Bounded Context in DDD
This might help you I assume the AuthService is in its designated bounded context for authentication and, Accounts is in that same bounded context too.Here are my answers:
TAG : oop
Date : January 02 2021, 06:48 AM , By : Juice
Why private variables in a class are accessible here?
Why private variables in a class are accessible here?
Does that help I have just started to use D language and I was trying out some object-oriented code. , See the "D Lang" Wiki:
TAG : oop
Date : January 02 2021, 06:48 AM , By : Nick Coats
Why encapsulation is known as Data Hiding?
Why encapsulation is known as Data Hiding?
Does that help You are "hiding" data from users of your object that should be able to use it without needing to know about its internals.The main reason for this is to allow you to later change these internals without breaking the code that calls int
TAG : oop
Date : January 02 2021, 06:48 AM , By : Frank Rotolo
What's the difference between entity and class?
What's the difference between entity and class?
around this issue A class is a template for an object (among other things), and is a very general concept.An entity has more semantic significance and is usually tied to a concept (possibly about a real object for example, an Employee or a Student or
TAG : oop
Date : January 02 2021, 06:48 AM , By : demize95
OOP: how much program logic should be encapsulated within related objects/classes as methods?
OOP: how much program logic should be encapsulated within related objects/classes as methods?
hope this fix your issue I have a simple program which can have an admin user or just a normal user. The program also has two classes: for UserAccount and AdminAccount. The things an admin will need to do (use cases) include Add_Account, Remove_Accou
TAG : oop
Date : January 02 2021, 06:48 AM , By : user142345
What's the difference between action and event?
What's the difference between action and event?
Does that help A user only provides actions (pressing on buttons, making selections in dialogs etc.) These actions get [sometimes] converted into events by the underlying framework. Events can be understood, conceptually, as [notification] "messages"
TAG : oop
Date : January 02 2021, 06:48 AM , By : Aki Björklund
What's the most used philosophy of keeping independent concepts separate in OOP?
What's the most used philosophy of keeping independent concepts separate in OOP?
wish of those help The 1 principle is encapsulation - at least the colleges have that part right.Inheritance, polymorphism, cohesion, concision, coupling, dependency, etc... all these things really fall under that one umbrella.
TAG : oop
Date : January 02 2021, 06:48 AM , By : eastcoastj
What is Encapsulation and how can it defend abstractions against corruption?
What is Encapsulation and how can it defend abstractions against corruption?
I wish this helpful for you Let's say you have a class with public methods that you must use to perform some action. The specification of the class say that, in order to do this action, you must configure the class in a specific way (call this method
TAG : oop
Date : January 02 2021, 06:48 AM , By : Rob
Is it a good object-oriented-design practice to send a pointer to private data to another class?
Is it a good object-oriented-design practice to send a pointer to private data to another class?
Hope this helps Yes, this is violating encapsulation the same way as exposing your variables as public. Only more tricky, since it is harder to detect.So usually it should be avoided. There are cases when this might be necessary, and if you can be re
TAG : oop
Date : January 02 2021, 06:48 AM , By : user186012
What is a good standard exercise to learn the OO features of a language?
What is a good standard exercise to learn the OO features of a language?
like below fixes the issue I can't imagine there could be a standard set of exercises that would naturally introduce OO features of a programming language to everybody. A lot of the introductory OO tutorials are full of Animals, Cats, and Dogs which
TAG : oop
Date : January 02 2021, 06:48 AM , By : Ivan Kitanovski
Design by Contract
Design by Contract
wish help you to fix your issue The preconditions are not the parameters, preconditions are expectations about parameters. For example, a precondition might be that param1 is never a null reference, while param2 is allowed to be null. param3 might be
TAG : oop
Date : December 27 2020, 04:20 PM , By : user179938
Static Object of a class in another class in aggregation relationship C++
Static Object of a class in another class in aggregation relationship C++
fixed the issue. Will look into that further You define the variable Controller::rec in the header file. That means the variable will be defined in every translation unit where that header file have been included. It should only be defined in one sin
TAG : oop
Date : December 22 2020, 04:01 PM , By : rusl
Understanding abstraction in OOP
Understanding abstraction in OOP
To fix the issue you can do In Object Oriented Programming, we generally think about Abstractions in terms of inheritance and polymorphism.Let's consider the Writer interface
TAG : oop
Date : December 21 2020, 01:00 PM , By : Erik
1:1:1 Coupling or 1:2 Coupling for OOP?
1:1:1 Coupling or 1:2 Coupling for OOP?
it should still fix some issue You shouldn't really have this option. Classes are not written just for fun, they model something, usually the business domain.So the question you should ask yourself is, does/should the concept of A know about both B a
TAG : oop
Date : December 05 2020, 11:52 AM , By : THD
Castle Windsor (or any IoC framework) and internal dependencies
Castle Windsor (or any IoC framework) and internal dependencies
Hope this helps I believe it can't be internal, as you can't pass an internal type to a public constructor.
TAG : oop
Date : November 22 2020, 02:42 PM , By : kiirpi
How to use OOP efficiently? Can I get some reference
How to use OOP efficiently? Can I get some reference
hop of those help? Here are some good books that helped me: Design Patterns - Elements of Reusable Object-Oriented Software Object Design - Roles, Responsibilities, and Collaborations - Rebecca Wirfs-Brock Analysis Patterns Reusable Object Models Ant
TAG : oop
Date : November 21 2020, 09:01 AM , By : mlapida
Is user class responsible for authentication?
Is user class responsible for authentication?
help you fix your problem Ideally no, that should be the job of the controller. User class should be just a data class, which is used by the controller (the business logic class) to evaluate things like Authenticate etc.Explanation:
TAG : oop
Date : November 21 2020, 07:31 AM , By : UnKnownUser
Is it bad to use a struct and treat it like a class to solve the dependency in Golang?
Is it bad to use a struct and treat it like a class to solve the dependency in Golang?
Hope that helps From overall conceptual standpoint there is nothing wrong in your implementation.On a detailed view there are inconsistencies that raise questions.
TAG : oop
Date : November 20 2020, 11:01 PM , By : Eran Yahav
Is a huge class ok for the sake of simplicity?
Is a huge class ok for the sake of simplicity?
seems to work fine Rather than pulling all the code into a new class, you could make a new class that itself contains no logic, but simply wraps around a Movie and exposes a large collection of methods that each call the neccesary methods on Movie an
TAG : oop
Date : November 19 2020, 01:01 AM , By : Bart van Bragt
OOP - How to call a class method internally in Reason
OOP - How to call a class method internally in Reason
seems to work fine This is where the as _; part of the class definition comes in, if you've ever wondered what that was for.createProductA and createProductB are methods, not functions, so they need to be called on an object. Reason/OCaml won't autom
TAG : oop
Date : November 18 2020, 03:01 PM , By : Pip
What is the job of 'Interface' in OO programming?
What is the job of 'Interface' in OO programming?
I wish did fix the issue. In the Java and .NET frameworks, among others, having a class X inherit from Y has two benefits:
TAG : oop
Date : November 14 2020, 05:18 PM , By : mobi phil
Why can/can't we apply OOP concepts as much to Kernel Programming?
Why can/can't we apply OOP concepts as much to Kernel Programming?
seems to work fine There are object oriented kernels. In fact, there's at least two kernels written in C (the projects are called singularity and cosmos).While it's not technically a problem with performance, as you can write very fast and efficient
TAG : oop
Date : November 14 2020, 05:16 PM , By : Lucyberad
How to separate your code from specific customer code?
How to separate your code from specific customer code?
will help you One strategy to deal with this is to pull the specifics "up" from this class to the "top", where it can be setup or configured properly.What I mean is:
TAG : oop
Date : November 14 2020, 03:01 PM , By : arbeitandy
Template referring to child class within parent class
Template referring to child class within parent class
I wish this helpful for you Sounds to me like you're looking for template this parameters.
TAG : oop
Date : November 13 2020, 03:01 PM , By : taviso
How do I define a static member function?
How do I define a static member function?
will be helpful for those in need I'm using golang to build a web server. And I'm using the MVC architecture. , You simply write a regular function, not a member function:
TAG : oop
Date : November 12 2020, 03:00 PM , By : liquidx
Go "polymorphism"
Go "polymorphism"
hop of those help? Your two exhibits are doing different things.In the first one, B has A embedded in it, and B doesn't implement the strange() method itself, so when you call b.strange(), you get the implementation of strange() defined for A. The re
TAG : oop
Date : November 11 2020, 11:01 PM , By : zdyne
What's the difference/relation between method, message and message passing?
What's the difference/relation between method, message and message passing?
it should still fix some issue If you read what Alan Kay (the guy who came up with the term "object-oriented" programming) says, it seems that he values the messaging aspect very much to the point where he suggested that it should be called "message-
TAG : oop
Date : November 11 2020, 03:01 PM , By : inquiringmind
How is it possible to have a purely object-oriented language?
How is it possible to have a purely object-oriented language?
fixed the issue. Will look into that further If you're asking if there are languages that have no way to interact with primitive types, then you might want to look at something like Scala. From that page:
TAG : oop
Date : November 09 2020, 03:01 PM , By : Jay Crockett
What is the best way to represent a form with hundreds of questions in a model
What is the best way to represent a form with hundreds of questions in a model
it helps some times I am trying to design an income return tax software. , One very generic approach could be XML XML allows you to
TAG : oop
Date : November 07 2020, 01:32 PM , By : CookingCoder
OOP: Bounds of a variable's scope
OOP: Bounds of a variable's scope
may help you . Variable scope defines parts of code where a variable can be accessed. Java has a few different scopes. The one you're asking about is local variable block scope. Java has other scopes like class scope.Also Java Language Spec.
TAG : oop
Date : November 05 2020, 11:01 PM , By : Adam Hill
Guidelines For Designing Clean Interface
Guidelines For Designing Clean Interface
should help you out Whole books have been written on this, and Framework Design Guidelines (.NET-centric) is one of my favorites. There's a lot to it, and no simple answer, but if I were pressed for a simple answer, I'd say design an API so that the
TAG : oop
Date : October 22 2020, 11:12 PM , By : Sigtryggur
What is Object Eclipsing?
What is Object Eclipsing?
To fix the issue you can do This is a question my interviewer asked me. My Answer is - , There is no such concept "object eclipsing".
TAG : oop
Date : October 17 2020, 11:12 PM , By : Stephen
Nim how to define constructors?
Nim how to define constructors?
seems to work fine Is there a way in Nim to define constructors for an object? For example I have
TAG : oop
Date : October 17 2020, 03:08 PM , By : tommy
What type of relationship is this for a Class Diagram
What type of relationship is this for a Class Diagram
may help you . This is a typical case of Generalization with Employee being the superclass and Manager as a subclass.
TAG : oop
Date : October 17 2020, 03:08 PM , By : Morbo
Design pattern name: Object of ClassA acts like a "class" for objects of ClassB
Design pattern name: Object of ClassA acts like a "class" for objects of ClassB
I think the issue was by ths following , This almost sounds like a power type. Maybe try something like this:
TAG : oop
Date : October 14 2020, 02:15 PM , By : beng
How to respect encapsulation when storing data in domain centric applications?
How to respect encapsulation when storing data in domain centric applications?
help you fix your problem This is an excellent observation in my opinion. No, I don't consider adding any methods just for technical reasons acceptable, especially getters. I must admit however, that the majority of people I've worked with would just
TAG : oop
Date : October 14 2020, 09:34 AM , By : bashmish
Does interface belong to ad hoc polymorphism (i.e. overloading) or subtype polymorphism?
Does interface belong to ad hoc polymorphism (i.e. overloading) or subtype polymorphism?
will help you Types has not type hierarchy, but Typeclasses has. I wouldn't think about type classes as class inheritance, because you don't have the parent structure, you just have the signature. They may be seen as the classic interfaces of OOP lan
TAG : oop
Date : October 08 2020, 12:00 AM , By : platformNomad
define generic TObjectList<T> that type T is determine at run time
define generic TObjectList<T> that type T is determine at run time
To fix the issue you can do Generic instantiation occurs at compile time and so you cannot specify the type parameter at runtime.As for what to do, it depends on the problem you are trying to solve.
TAG : oop
Date : October 07 2020, 07:00 PM , By : Raghaw
Flyweight/OOP design patterns in Julia
Flyweight/OOP design patterns in Julia
hop of those help? In the Julia world the best equivalent seems to be the Memoize package
TAG : oop
Date : October 06 2020, 08:00 AM , By : fukas78
What happens if I create an object of a class A but there also exist a duplicate class of A with same name?
What happens if I create an object of a class A but there also exist a duplicate class of A with same name?
I wish did fix the issue. You can't have two classes with same name in the same scope. This is no good:
TAG : oop
Date : October 05 2020, 01:00 PM , By : Rit Li
What is the difference between processes/messages in Erlang and objects/messages in Smalltalk?
What is the difference between processes/messages in Erlang and objects/messages in Smalltalk?
wish helps you Processes in Erlang and Objects in Smalltalk are indeed the same thing.At first glance, this is not terribly surprising: Erlang is an Actor Model language. The Actor Model was invented by Carl Hewitt, who based the message-driven evalu
TAG : oop
Date : September 28 2020, 04:00 PM , By : ERaubenheimer
What are the disadvantages of the ECS (Entity-Component-System) architectural pattern, compared to OOP (or other paradig
What are the disadvantages of the ECS (Entity-Component-System) architectural pattern, compared to OOP (or other paradig
To fix this issue Because of Unity ECS, I've been reading a lot about ECS lately. , Here's a few points I gathered from my research:
TAG : oop
Date : September 28 2020, 01:00 PM , By : LucaN
How can you dynamically generate values for use with traits?
How can you dynamically generate values for use with traits?
wish of those help Trait application is set up during compilation, so we need a way to generate a value for it to use during compilation as well. This can be done using the BEGIN phaser, but this is better written with constant in this case.Constants
TAG : oop
Date : September 28 2020, 02:00 AM , By : 66.
How to implement around in Raku
How to implement around in Raku
will be helpful for those in need In Perl, using Moo, you can implement around subs, which will wrap around other methods in a class. , You can shadow the method with the role and then use callwith:
TAG : oop
Date : September 27 2020, 06:00 PM , By : T11M
Coupling - How does changing one module effect another OTHER THAN changing method signature or return type?
Coupling - How does changing one module effect another OTHER THAN changing method signature or return type?
I wish this help you Even though this is tagged "Java", I'm going to give a broader answer.Coupling is expressed in terms of what assumption module A makes when it uses module B. The more assumptions module A makes, the more it is coupled with module
TAG : oop
Date : September 27 2020, 06:00 AM , By : Dov
When is it okay to depend on concrete classes?
When is it okay to depend on concrete classes?
I wish this helpful for you In OOP, an object is the encapsulated combination of data and behavior. The data is hidden; the behavior is exposed. It is these objects to which the DIP applies. Ideally, these objects should be instantiated in a Composit
TAG : oop
Date : September 23 2020, 09:00 AM , By : TheDave1022
Passing a method vs. passing an interface in Kotlin
Passing a method vs. passing an interface in Kotlin
Any of those help In Kotlin both of these methods are correct and can be used depending on your use case. Unlike Java which was primarily an Object Oriented language but later included some functional programming features with the introduction of jav
TAG : oop
Date : September 12 2020, 10:00 PM , By : Jesse
shadow
Privacy Policy - Terms - Contact Us © scrbit.com