apache / apache/dubbo-go

how to implement the Java Overload method in dubbogo

Open
#1,780 6 comments 0 reactions 0 assignees View on GitHub
good first issue
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.