Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields of sub-types should not be added to the current service field list. #18

Closed

Conversation

miroslavmaric
Copy link

If they are added, then the list of fields for the current service will contain phantom-fields (fields which do not exist for the current service).

… are added, then the list of fields for the current service will contain phantom-fields (fields which do not exist for the current service)
@chenjianjx
Copy link
Owner

Nah...

Fields of subtypes are "possible" fields, not phantom fields. It's important to show them for services which return a parent class object. It's actually a core feature of wsdl2html

Are you letting a class extend a concrete class? People may disagree but that's a little anti-pattern. The problem is when you are given an object of concrete class Bean, you don't know if it is a Bean itself, or a SubBean (its child). Robert Martin C. said something about this problem before.

What you can do is to make Bean class abstract and put all the fields and methods there, and let there be a DefaultBean as it's sunclass without extra implementation, then let your current SubBean to extend the abstract Bean. For a service which only returns the default fields, using DefaultBean. For services that may or may not extra fields, return Bean.

@chenjianjx chenjianjx closed this Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants