Skip to content

Commit 4f8387e

Browse files
committed
use common extends terminology
1 parent 76f8c31 commit 4f8387e

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

grails-doc/src/en/guide/scaffolding.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ class BookController {
111111

112112
This controller will automatically locate and use the corresponding `BookService` for all data operations.
113113

114-
===== Custom Base Classes
114+
===== Extending Custom Classes
115115

116-
You can specify a custom superclass for your scaffolded controllers or services:
116+
You can specify a custom class to extend for your scaffolded controllers or services:
117117

118118
[source,groovy]
119119
----
@@ -255,19 +255,19 @@ The `create-scaffold-controller` command supports the following options:
255255
* `--force` - Overwrite existing files
256256
* `--namespace` - Set the controller namespace
257257
* `--service` - Use `grails.plugin.scaffolding.RestfulServiceController` instead of `grails.rest.RestfulController`
258-
* `--extends` - Specify a custom superclass (default: `grails.rest.RestfulController`)
258+
* `--extends` - Specify a custom class to extend (default: `grails.rest.RestfulController`)
259259

260260
The `create-scaffold-service` command supports:
261261

262262
* `--force` - Overwrite existing files
263-
* `--extends` - Specify a custom superclass (default: `grails.plugin.scaffolding.GormService`)
263+
* `--extends` - Specify a custom class to extend (default: `grails.plugin.scaffolding.GormService`)
264264

265265
The `generate-scaffold-all` command supports:
266266

267267
* `--force` - Overwrite existing files
268268
* `--namespace` - Set the controller namespace
269-
* `--serviceExtends` - Specify a custom superclass for the service (default: `grails.plugin.scaffolding.GormService`)
270-
* `--controllerExtends` - Specify a custom superclass for the controller (default: `grails.plugin.scaffolding.RestfulServiceController`)
269+
* `--serviceExtends` - Specify a custom class to extend for the service (default: `grails.plugin.scaffolding.GormService`)
270+
* `--controllerExtends` - Specify a custom class to extend for the controller (default: `grails.plugin.scaffolding.RestfulServiceController`)
271271

272272
Examples:
273273

@@ -276,7 +276,7 @@ Examples:
276276
# Generate a scaffolded controller that uses a service
277277
grails create-scaffold-controller Book --service
278278
279-
# Generate with a custom base class
279+
# Generate with a custom class to extend
280280
grails create-scaffold-service Book --extends=com.example.MyCustomService
281281
282282
# Generate both with namespace

grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/annotation/Scaffold.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* @Scaffold(Car.class)
4444
* class CarService {} // → extends GormService<Car>
4545
*
46-
* // Explicit: specify both base and domain
46+
* // Explicit: specify both class to extend and domain
4747
* @Scaffold(value = GormService.class, domain = Car.class)
4848
* class CarService {} // → extends GormService<Car>
4949
*
@@ -58,7 +58,7 @@
5858
* @Scaffold(Car.class)
5959
* class CarController {} // → extends RestfulController<Car>
6060
*
61-
* // Explicit: specify both base and domain
61+
* // Explicit: specify both class to extend and domain
6262
* @Scaffold(value = RestfulController.class, domain = Car.class)
6363
* class CarController {} // → extends RestfulController<Car>
6464
* }</pre>
@@ -71,41 +71,41 @@
7171
public @interface Scaffold {
7272

7373
/**
74-
* Base class to extend OR domain class (context-dependent).
74+
* Class to extend OR domain class (context-dependent).
7575
*
7676
* <p><b>Interpretation:</b></p>
7777
* <ul>
7878
* <li>If value has generics (e.g., {@code GormService<Car>}):
7979
* <ul>
80-
* <li>Base class = {@code GormService}</li>
80+
* <li>Extends {@code GormService}</li>
8181
* <li>Domain class = {@code Car} (extracted from generic)</li>
8282
* </ul>
8383
* </li>
84-
* <li>If value is a known base class (e.g., {@code GormService}):
84+
* <li>If value is a scaffold class (e.g., {@code GormService}):
8585
* <ul>
86-
* <li>Base class = value</li>
86+
* <li>Extends value</li>
8787
* <li>Domain class = from {@link #domain()} parameter</li>
8888
* </ul>
8989
* </li>
9090
* <li>Otherwise (e.g., {@code Car}):
9191
* <ul>
9292
* <li>Domain class = value</li>
93-
* <li>Base class = default for artefact type</li>
93+
* <li>Extends default for artefact type</li>
9494
* </ul>
9595
* </li>
9696
* </ul>
9797
*
98-
* @return the base class or domain class
98+
* @return the class to extend or domain class
9999
*/
100100
Class<?> value() default Void.class;
101101

102102
/**
103103
* Domain/entity class (alternative to value).
104-
* More explicit when also specifying base class.
104+
* More explicit when also specifying the class to extend.
105105
*
106106
* <p>Examples:</p>
107107
* <pre>{@code
108-
* @Scaffold(domain = Car.class) // Uses default base
108+
* @Scaffold(domain = Car.class) // Uses default
109109
* @Scaffold(value = JpaScaffoldService.class, domain = Car.class)
110110
* }</pre>
111111
*
@@ -115,7 +115,7 @@
115115

116116
/**
117117
* Whether this service/controller is read-only.
118-
* Passed to constructor of base class.
118+
* Passed to constructor of the extended class.
119119
*
120120
* <p>For services: mutations throw {@code ReadOnlyServiceException}
121121
* <p>For controllers: mutation endpoints may return 405 Method Not Allowed

grails-scaffolding/src/main/scripts/CreateScaffoldController.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ description("Creates a scaffolded controller") {
2424
flag name:'force', description:"Whether to overwrite existing files"
2525
flag name:'namespace', description:"The namespace for the controller"
2626
flag name:'service', description:"Use grails.plugin.scaffolding.RestfulServiceController instead of grails.rest.RestfulController"
27-
flag name:'extends', description:"The superclass for the controller (default: grails.rest.RestfulController)"
27+
flag name:'extends', description:"The class to extend (default: grails.rest.RestfulController)"
2828
}
2929

3030
def modelInstance = model(args[0])

grails-scaffolding/src/main/scripts/CreateScaffoldService.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ description("Creates a scaffolded service") {
2222
completer org.grails.cli.interactive.completers.DomainClassCompleter
2323
argument name:'Service Name', description:"The name of service", required:true
2424
flag name:'force', description:"Whether to overwrite existing files"
25-
flag name:'extends', description:"The superclass for the service (default: grails.plugin.scaffolding.GormService)"
25+
flag name:'extends', description:"The class to extend (default: grails.plugin.scaffolding.GormService)"
2626
}
2727

2828
def modelInstance = model(args[0])

grails-scaffolding/src/main/scripts/GenerateScaffoldAll.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ description("Generates a scaffolded service and controller") {
2323
argument name:'Domain Class Name', description:"The name of domain class", required:true
2424
flag name:'force', description:"Whether to overwrite existing files"
2525
flag name:'namespace', description:"The namespace for the controller"
26-
flag name:'serviceExtends', description:"The superclass for the service (default: grails.plugin.scaffolding.GormService)"
27-
flag name:'controllerExtends', description:"The superclass for the controller (default: grails.plugin.scaffolding.RestfulServiceController)"
26+
flag name:'serviceExtends', description:"The class to extend for the service (default: grails.plugin.scaffolding.GormService)"
27+
flag name:'controllerExtends', description:"The class to extend for the controller (default: grails.plugin.scaffolding.RestfulServiceController)"
2828
}
2929

3030
def modelInstance = model(args[0])

0 commit comments

Comments
 (0)