jason810496 commented on code in PR #71057:
URL: https://github.com/apache/airflow/pull/71057#discussion_r3773788633


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/DagDef.kt:
##########
@@ -24,46 +24,72 @@ import kotlin.Throws
 /**
  * A collection of tasks with directional dependencies.
  *
- * Create a [Dag] directly and register tasks with [addTask].
+ * Create a [DagDef] directly and register [TaskDef]s with [addTask].
  *
  * The [Builder.Dag] annotation should generally be preferred in user code,
  * where the annotation processor generates the wiring for you. Only use this
- * class directly if you need to do low-level plumbing.
+ * class directly if you need to do low-level plumbing:
+ *
+ * ```java
+ * var dag = new DagDef("java_etl")
+ *     .addTask(new TaskDef("extract", Extract.class))
+ *     .addTask(new TaskDef("load", Load.class));
+ * ```
  *
  * @param id Dag identifier. Must contain only ASCII alphanumeric characters,
  *    dashes, dots, or underscores; must be unique within a [Bundle].
  *
  * @see Builder.Dag
  */
-class Dag(
+class DagDef(

Review Comment:
   The interface with the `execute` method already called `Task` (`public 
static class Transform implements Task {`), so I name the new object here as 
`TaskRef`.
   
   If we name the `TaskRef` here as `Task`, then the old `Task` interface 
should be renamed into something like `TaskFunction, TaskImplementation or 
TaskCallable` to avoid the ambiguity. 
   
   Both work with me, no strong opinion on the naming.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to