in some sources such as the original article of Martin Fowler aren't written that methods would return the same object, and methods in examples return different objects but in some sources(newer) such as Wikipedia is written that method would return the same object, which is correct?
Is it necessary to return the same object in methods with fluent interface
46 Views Asked by Gor Madatyan At
1
There are 1 best solutions below
Related Questions in OOP
- How do I apply the interface concept with the base-class in design?
- Creating multiple instances of a class with different initializing values in Flutter
- System.InvalidCastException while inheriting a class
- How to add logging to an abstract class in php
- creating cutscenes using OOP and pygame
- What effect does the `virtual` modifier have on an interface member?
- How to pass the value of a function of one class to a function of another with the @property decorator
- Creating a C++ Class Instance for every server request?
- Dart OOP programming
- Containing Object Design
- Clean architecture/OOP and optimization: how to organize for classes with same logic
- How to get 5 LEVEL hierarchy users from database using PHP and MYSQL
- TypeError: unsupported operand type(s) for /: 'property' and 'complex'
- How can I refer to this metaclass inside a metaclass without specifying its name in the code?
- Why customed "-eq" do twice in Powershell?
Related Questions in DSL
- Jmeter Java DSL - getting issues when using rpsThreadGroup
- How to set up URL redirection on D-Link router for specific domain?
- Build array of objects with PactDsl for json request
- Adding my own transpiled file format to Typescript imports
- Nextflow - I/O and index issues
- How can I use version catalogs with Kotlin DSL?
- Groovy dsl dependency injection
- Groovy DSL SecureASTCustomerizer IDE integration
- How to classify this interpreter
- Is this Ruby syntax or is it a DSL and how can I learn Ruby syntax or Rails DSL?
- mutliple definition of preproccessor # value
- Using Groovy map for DSL arguments
- Complex Swift DSL with inter-relationships
- Function literal with a receiver invocation
- How do I eliminate data duplication in querydsl?
Related Questions in METHOD-CHAINING
- Python method chaining in a for loop
- Fluent interfaces with pipelining or method chaining in Python
- How to Select First N Key-ordered Values of column within a grouping variable in Pandas DataFrame
- Chain method grouping and calculating differences in a Pandas DataFrame
- Is it necessary to return the same object in methods with fluent interface
- The different between fluent interface and method cascading implemented by method chaining
- copy a dataframe to new variable with method chaining
- Data Wrangling in Python in Chaining Style from R
- Equivalent of pandas .append() method, which allows method chaining
- pandas: assign a column values by slice with method chaining
- In a chaining call, is copy assignment called?
- Python convention indicating whether method chaining is method cascading?
- How do you efficiently chain array methods in Ruby
- How to simplify this code in Javascript via function chaining?
- how to annotate a generic type that has a generic type in python?
Related Questions in FLUENT-INTERFACE
- Jersey fluent API troubles
- Fluent API with multiple generic parameters and inheritance
- wrong number of arguments error while building a chainable ruby api
- Multiplicity constraint violations with optional-required EF Code First + Fluent relationship?
- Reusing a column for a required property with Entity Framework 6.0, Fluent API, and DataAnnotations
- How to get the MaxLength from a Fluent API mapping specification in runtime?
- How far is too far with fluent C#?
- Code-First Reference one-to-many
- Does defining a fluent interface have a performance impact?
- Mapping Relationship with Legacy Database using Entity Framework CTP5
- Is there a fluent email library for c#?
- Use .png as custom ribbon icon in Access 2007
- EF4 CodeFirst CTP5 nvarchar(max) via attribute
- Fluent interface in Delphi
- Pros and Cons of Fluent and XML Configuration
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is no correct or right way to write fluent interface.
Even Fowler's article uses both kinds of returned objects, but you don't see it easily because it shows usage, not the implementation.
Usually when you are configuring some object, it will only make sense that you return the same object. Otherwise you would have to clone it first and then apply additional value.
But there are scenarios where fluent interface will eventually return some other object in the sequence regardless if it is the same or of some other type.