Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I'm new to SOLID principle and design, I understand the principle however, I have a hard time knowing where to start the design process. I understand that design is an iterative process, what step or question you ask yourself during the design process so your design conforms to SOLID.
Try test-driven development. In an object-oriented context, you'll typically have to explicitly consider both the Open Closed Principle, the Dependency Inversion Principle, and the Liskov Substitution Principle in order to make your system under test testable and deterministic.
There are other ways to make APIs testable. If, for example, you're using functional programming, pure functions are intrinsically testable. In that case, you don't need to explicitly think about SOLID.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I read about OOP and Function programming. And I found both have pros and cons.
Such as:
OOP: have side effect, and sometimes it is very usefull
Function: easy to code and think. But don't have side effect and loop.
And I wonder if I can using both OOP and Function paradigm in one project. Is it be recommended in practice?
There's nothing preventing both paradigms from being used together. Arguments on each side sometimes can be misleading as people tend to focus on languages and their features as opposed to the paradigms themselves. OOP doesn't need to have state/side effects, and functional programming doesn't always make things easier or faster. The good engineer will use the right tools for the right task, which means getting a good understanding of both.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
How Composition is a lesser principle level, than Inheritance? One always has to consider Composition over Inheritance, but there is no mention of Composition in the four major OOP principles. What is the reason behind this? Are they not at the same level?
Composition is a lower-level and a much older concept than inheritance; it comes from the analysis-synthesis approach which basically states that things are either composed of other things or trivial (atomic). It was first introduced back in ancient Greece as a general approach to understanding things.
Composition is not specific to OOP, e.g. in plain C, which is far from being OO, structs are authored using composition, likewise in functional programming functions are composed of other functions, though the nature of composition is totally different in these two examples.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am having a very strange question, although I am learning OOPS through C++ since last few months. That why there is a need of a construct like class?
There is no need for classes in object-oriented programming. There are lots of languages which do just fine without them: Self, Io, Ioke, Seph, Slate, NewtonScript and ECMAScript have only objects, no classes. Other languages have mixins. Yet other languages have traits. Some languages have classes and mixins, some classes and traits.
The only thing you really need for object-orientation is some way to perform procedural abstraction. That's it. Lambda Calculus is a perfectly fine OO language, in fact, since it has only procedural (well, actually functional) abstraction and nothing else, one might argue that Lambda Calculus is the purest OO language of all.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm looking for some guidelines on writing a technical spec. This spec will be given to contract programmers for writing the business logic in an application. There is no user interaction in these applications, only application to application interaction. So far I've only been able to find information on writing specifications based on user input. I was thinking that maybe UML would be useful for this, but I'm not sure.
If anyone could point me in the right direction I would appreciate it. Thanks!
My suggestion is; if you doesn't have a lot of time to spend on this make some input/output sketches of the functions combined with UML flow diagrams. If you have time and some money to spend I can recomend "Object-oriented Modelling and Design with UML" by Michael Blaha and James Rumbaugh. read it and apply it on your requirements but instead of going to implementation leave it to the contract programmers. It is more time upfront but less questions later. Hope it helps.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
When companies ask you to do OO design related questions in the interview, what do they really expect? Do they expect you to briefly tell them the algorithm and some pseudocode or do they actually expect you to write the entire structure of the code?
For example question like : Design a musical jukebox. Do I start off telling what classes I will make with some pseudocode or what?
Design does not mean implementation.
Design means:
what all classes you will have
The methods(functionality) your classes will provide
What will be the relation between classes you have
What will be the Lifetimes of objects of your classed
Having said a design is not something which gets done in a mere 15-20mins of an interview.It's all blood and sweat and it needs lot of time and consideration albeit discussions to arrive at a good design.
In a interview the Questioner usually want to know if you can think in the right direction atleast.