Top "Factory" questions

"Factory" is a general term for object-oriented programming patterns which create objects.

Does a framework like Factory Girl exist for Java?

Factory Girl is a handy framework in rails for easily creating instances of models for testing. From the Factory Girl …

java ruby-on-rails unit-testing factory factory-bot
Spring: Getting FactoryBean object instead of FactoryBean.getObject()

Short question: If I have class that impelemnts FactoryBean interface, how can I get from FactoryBean object itself instead of …

java spring factory spring-batch
Angular js returning undefined object from factory

I have a controller and factory defined as below. myApp.controller('ListController', function($scope, ListFactory) { $scope.posts = ListFactory.get(); console.…

ajax angularjs factory angularjs-factory
Enum factory-style method

In my application, several different reports can be generated (CSV, HTML, etc). Instead of creating a traditional factory-style method pattern, …

java enums factory
How to use Faker from Factory_boy

Factory_boy uses fake-factory (Faker) to generate random values, I would like to generate some random values in my Django …

python django factory faker factory-boy
PhpStorm type-hinting for factories?

I have code more or less like this: class Foo { public static function factory($str) { $class = "Foo_" . $str; return new $…

factory phpstorm type-hinting
Dart factory constructor - how is it different to “const” constructor

In Dart, factory constructors needs more logic from coders, but not so different from const ones except they permit 'Non …

constructor dart factory
Factory for Thread Safe Singleton in Java

This is a sample of the basic pattern I've been using for a Factory that returns a thread-safe Singleton: public …

java multithreading singleton factory
Passing array values to laravel factory

I'm trying to create a fake data seeder using fzaninotto/faker and factory in Laravel 5.4. I want to send an …

php laravel laravel-5.4 factory faker
RSPEC and factory girl SystemStackError: stack level too deep

I have trying to solve an issue with my Spec tests and I get the following error Failures: 1) SessionsController POST …

ruby-on-rails rspec factory-bot factory