Is a factory method using the constructor/class na...
# getting-started
h
Is a factory method using the constructor/class name considered hackish? Something like
Copy code
class Foo(
    val prop1: String = "",
    val prop2: Boolean = true,
    val prop3: Int = 0,
    val prop4: String = ""
)

fun Foo(initString: String): Foo {
    // do some complicated parsing with the initString
    // ...
    val prop1 = ...
    val prop2 = ...
    val prop3 = ...
    val prop4 = ...
    return Foo(prop1, prop2, prop3, prop4)
}