Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
76 views

I am doing some unit testing with PHP. I got stuck on an error that the fluent interface of PHPUnit requires an intermediate variable. What is the reason for this behavior? See MyTests::works vs. ...
Sven Eppler's user avatar
  • 1,796
1 vote
1 answer
108 views

I've created a small library called StreamX, which acts like a type-safe, index-aware zipper to enable parallel streaming over multiple lists. It supports functional operations like forEach, map, ...
M S's user avatar
  • 19
0 votes
0 answers
36 views

I have a collection with objects of different types, each of them inheriting from a class named Component. I then want to modify the collections by my needs nicely, with use of kind of declarative and ...
codymanix's user avatar
  • 29.6k
1 vote
0 answers
62 views

Good time of the day! I have a generic interface which has a self-reference: public interface IBuilder<TObject, TBuilder> where TBuilder : IBuilder<TObject, TBuilder> { public ...
Ruafel's user avatar
  • 33
0 votes
1 answer
70 views

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 ...
Gor Madatyan's user avatar
1 vote
1 answer
118 views

When I read about it on Wikipedia, it seemed to me that these two are almost the same, but the same article says that they differ not only in the use of DSL. Note that a "fluent interface" ...
Gor Madatyan's user avatar
1 vote
2 answers
252 views

Why should I use fluent interface in Delphi instead of using 'with command'? I heard about both, but I haven't found the difference. I'm trying to find the best one for my project. ​It seems to work ...
Guilherme Goncalves's user avatar
0 votes
3 answers
472 views

I'm developing .NET core app that using selenium, so I've designed the logic using fluent interface that make the code more readable and maintained. I have a problem which is how to make a conditional ...
Karim Fahmy's user avatar
0 votes
1 answer
78 views

I'm implementing a Fluent Builder Interface and instead of having null, empty or whitespace checks, I force the developer to fill in the following mandatory fields: firstName, prefix and facultyNumber....
nop's user avatar
  • 6,617
0 votes
0 answers
25 views

Most of the time, we can replace a fluent interface with named parameters. class Cart { fun withItems(vararg items: Item) = this } fun aCart(): Cart { TODO() } class Item fun anItem(): Item ...
ibrahim koz's user avatar
0 votes
1 answer
70 views

I got some problem and I don't know how to fix it. this is sample for the problem class DancingClass { private static $associate = []; private static $first; public static function first($...
lucky's user avatar
  • 1
0 votes
1 answer
2k views

What are the benefits (or drawbacks) of returning a reference to 'this' object in a method that modifies itself? When should returning a 'this' be used as apposed to void? When looking at an answer on ...
Lazy Turtle's user avatar
0 votes
1 answer
137 views

I'm trying to create an object-configurator using a fluent interface. Code: class Configurator { public: Configurator() { printf("Constructor.\n"); } ~Configurator() { ...
user1562's user avatar
-1 votes
1 answer
119 views

I want to create a class only for setting params for function. I'm using a fluent interface for that. Some function returns the object to setting params and real code will execute in the destructor of ...
User98's user avatar
  • 51
0 votes
2 answers
7k views

I'm working on java selenium tests and I am trying to setup a fluent/method-chaining design code: I have a generic button class that allows navigating from a page class to the other. Buttons are ...
Batou's user avatar
  • 120
1 vote
1 answer
418 views

I am working on a project that has a fair amount of data objects that use a "fluent interface" or "method chaining" on their setters so all of the setters in each data object return this. I have ...
Cahlen Brancheau's user avatar
0 votes
0 answers
94 views

I want to achieve API to client to look like this: (modifying subcomponents by using fluent interface) FluentMainComponent("|FluentMainComponent|") .setA() .SetText("fa2")...
Asmozan's user avatar
  • 125
2 votes
1 answer
1k views

I am having trouble mapping the following classes. I want MainAboutPage to be optional (one-to-zero-or-one) and AboutSubPages is obviously one-to-many. Ideally I want to keep the WebsiteId ...
Carmax's user avatar
  • 2,937
0 votes
1 answer
57 views

I need help making my Query object not have a recursion error. To check the right amount of function have been chain-called I am adding a counter to get attribute that caused a recursion error. This ...
OneCrazyGenius's user avatar
0 votes
0 answers
250 views

I'm trying to follow this document (https://docs.jboss.org/jbpm/release/7.3.0.Final/jbpm-docs/html_single/#_process_fluent_api) to use jBPM fluent api to create a process. But I'm wondering how to add ...
user3593261's user avatar
1 vote
1 answer
91 views

I'm trying to create API integration tests for legacy code I've inherited. Currently I have a piece of testing code that: recreate database (using Fluent Migrations) starts a web app (Owin.Hosting) ...
user2947245's user avatar
0 votes
1 answer
59 views

Is this possible to create something like Find.Elements.By.Name(string name) using fluent api design pattern in c#? If so, how?
Jason's user avatar
  • 1,868
0 votes
0 answers
48 views

Hello i am trying to create a fluent API for an object.I create a builder object that will get its dependencies and then i will build the resulting object. The problem is that i need to perform some ...
Bercovici Adrian's user avatar
0 votes
2 answers
372 views

Hello i want to be able to set the a of a field of an object only in an extension method. I would want that this field to either be completelely private , or be just get-able from outside: public ...
Bercovici Adrian's user avatar
4 votes
2 answers
2k views

In C#, we can use Func<> and Action<> types to store what are essentially managed pointers to methods. However, in my experience, they need to be explicitly typed when defined: Func<int&...
Haus's user avatar
  • 1,502
0 votes
1 answer
121 views

I'm trying to extract a value from a nested JSONObject, say "id". I'm using org.json.simple package and my code looks like: JSONArray entries = (JSONArray) response.get("entries"); JSONObject entry =...
Eric Hung's user avatar
  • 532
2 votes
1 answer
296 views

Why Fluent API is called "API" ? Fluent API is a way to create fluent Domain Specific Language, whereas API is "Appication Programming Interface". API is: "A set of functions and procedures that ...
JohnIdlewood's user avatar
1 vote
1 answer
128 views

Using Entity Framework's Fluent API, I can successfully insert a new row in the user's table using this code: modelBuilder.Entity<User>().ToTable("Users"); modelBuilder.Entity<User>()....
IMOsiris's user avatar
  • 155
0 votes
1 answer
286 views

There are two classes defined as follows: class Foo { private $aaa; public function setAaa(Aaa $aaa): self { $this->aaa = $aaa; return $this; } } class Bar extends ...
automatix's user avatar
  • 15.2k
9 votes
1 answer
4k views

I'm using FluentEmail in ASP.NET core 2.0 class library which will be sending the Email notification. Below is the sample code I have tried till now: using FluentEmail.Core; using FluentEmail.Razor; ...
I Love Stackoverflow's user avatar
2 votes
1 answer
243 views

Is there a way to chain calls to superclass from subclass without casting, overriding the method or using interfaces. E.g. when doing class A { public: A& foo() { return *this; } }; class ...
Johan's user avatar
  • 1,723
1 vote
1 answer
296 views

I need to create a function of this type, I do not know how it is done and I would like to learn the function adds to the database, and receives some parameters event($user)->balande(2.00)->...
Andres Mahecha's user avatar
2 votes
1 answer
1k views

Suppose I have a parent class and multiple child classes, which extend the parent class by including more specific information about the ideas they represent. For example: class Shape: def ...
Scott's user avatar
  • 319
1 vote
1 answer
1k views

I am developing language dictionary with asp core 2.0. I wonder how to properly design my database. I came across similar question: How to design a database for translation dictionary?. I decided ...
Taras Kryvko's user avatar
1 vote
2 answers
52 views

I'm exactly want to call function into function into class, like how exactly laravel works with oop php example: App\Flight::where('active', 1)->orderBy('name', 'desc') ->take(10)->get(); ...
Eslam Hussein's user avatar
20 votes
2 answers
18k views

I would like to do multiple re.sub() replacements on a string and I'm replacing with different strings each time. This looks so repetitive when I have many substrings to replace. Can someone please ...
JTFouquier's user avatar
4 votes
3 answers
457 views

I'm trying to using a fluent interface to build a collection, similar to this (simplified) example: var a = StartWith(1).Add(2).Add(3).Add(4).ToArray(); /* a = int[] {1,2,3,4}; */ The best ...
James Curran's user avatar
0 votes
1 answer
47 views

Let's say I have a class: class A { public A fun() { System.out.println("a"); return this; } } And a scenario: A a = new A(); a.fun().fun().fun().fun(); a.fun().fun(); Is ...
xinaiz's user avatar
  • 7,798
6 votes
4 answers
4k views

I wanted to know the exact difference between method chaining and fluent interface. As I understand it, method chaining is just running the methods of previous method return objects while avoiding ...
silvia Dominguez's user avatar
1 vote
1 answer
534 views

In Scala - we can do extension methods like this: object MyExtensions { implicit class RichInt(val i: Int) extends AnyVal { def square = i * i } } We can use it like this: import ...
hawkeye's user avatar
  • 36k
0 votes
1 answer
406 views

I'm writing a fluent API to validate key:value pair in a Map. I have a hierarchy of validator types. I referred to one answer from Fluent API with inheritance and generics. public interface ...
Lazysheep.wang's user avatar
1 vote
0 answers
234 views

Does anyone have an experience in using Fluent Interface (or chaining method) with SIMD and other levels of parallelism using C++? Is there any performance penalty, side effects, e.g. on instruction-...
Nikolai Arsenov's user avatar
8 votes
3 answers
25k views

We are familiar with fluent interfaces for calling methods in java and other programming languages. For eg: Picasso.with(this).load(url).into(imageView); This is made possible by setter methods what ...
erluxman's user avatar
  • 19.6k
0 votes
0 answers
394 views

I have a fluent API which I am trying to add another implementation for by passing in an enum to determine which object will be created and delegated to behind the scenes. It's for a UI testing ...
thisextendsthat's user avatar
1 vote
3 answers
132 views

What I am looking for is, having non-fluent class: class NonFluent { int i=0; public: void setValue(int i) {this->i = i;} void multiplyValue(int i) {this->i *= i;} int getValue()...
xinaiz's user avatar
  • 7,798
4 votes
2 answers
3k views

There is an existing C API that looks like this: //data typedef struct {int properties;} Widget; //interface Widget* SetWidth(Widget *const w, int width){ // ... return w; } Widget* ...
Trevor Hickey's user avatar
0 votes
0 answers
240 views

FluentIterable.index returns an ImmutableListMultimap, which ceases to be fluent. That means if I want to transform the existing map I will have to wrap the entire thing in another FluentIterable ...
user69715's user avatar
  • 894
1 vote
1 answer
127 views

I have these three Interfaces as part of the Fluent Interface API (where a lot of method chaining happens): interface VerifierA extends VerifierC { VerifierA method1(); // other ...
Andrejs's user avatar
  • 12.1k
0 votes
0 answers
28 views

I am trying to implement a fluent API that contains specialized derived classes and I am using the Derived extends Base<Derived> method to obtain this parameter as Derived from base methods, but ...
Jezor's user avatar
  • 3,436
0 votes
1 answer
39 views

In my gem I have a class called Client that I want to operate like this: client = Client.new client.content_type('pages').content_type That means I want to set a property and then expect to ...
Amit Erandole's user avatar

1
2 3 4 5
9