how to implement the Java Overload method in dubbogo
- Dominant language
- Go
- Stars
- 5k
- Forks
- 1k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 31
Description
```
// java
public class CommentServiceImpl implements CommentService {
public boolean isForbidsSpeak(Long bookId, Long userId);
public boolean isForbidsSpeak(Long bookId, Long userId, String ip);
......
}
```
```
// go
type CommentServiceProvider struct{}
func (p *CommentServiceProvider) IsForbidsSpeak(ctx context.Context, params []interface{}) (interface{}, error) {
l := len(params)
if l == 2 {
// TODO
} else if l == 3 {
// TODO
} else {
// TODO
}
return nil, nil
}
func (p *CommentServiceProvider) MethodMapper() map[string]string {
return map[string]string{
"IsForbidsSpeak": "isForbidsSpeak",
}
}
```
Contributor guide
Research direction
Start with the CommentServiceImpl overload declarations and the CommentServiceProvider IsForbidsSpeak and MethodMapper entry points shown in the issue. Determine how dubbogo maps overloaded Java methods to the Go params slice and define the behavior for two and three arguments; done means both overloads are dispatched correctly and invalid arities are handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100