You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2018/12/04 05:26:00 UTC

[jira] [Commented] (SPARK-26244) Do not use case class as public API

    [ https://issues.apache.org/jira/browse/SPARK-26244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708220#comment-16708220 ] 

Wenchen Fan commented on SPARK-26244:
-------------------------------------

I took a quick look, and seems most of the public case class APIs are OK, like `SparkListenerEvent` implementations. Feel free to add more subtasks if you found something to fix. cc [~srowen] [~hyukjin.kwon]

> Do not use case class as public API
> -----------------------------------
>
>                 Key: SPARK-26244
>                 URL: https://issues.apache.org/jira/browse/SPARK-26244
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core, SQL
>    Affects Versions: 3.0.0
>            Reporter: Wenchen Fan
>            Priority: Major
>              Labels: release-notes
>
> It's a bad idea to use case class as public API, as it has a very wide surface. For example, the copy method, its fields, the companion object, etc.
> I don't think it's expect to expose so many stuff to end users, and usually we only want to expose a few methods.
> We should use a pure trait as public API, and use case class as an implementation, which should be private and hide from end users.
> Changing class to interface is not binary compatible(but source compatible), so 3.0 is a good chance to do it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org