fixture-monkey icon indicating copy to clipboard operation
fixture-monkey copied to clipboard

Extend MatcherOperator to manage ArbitraryBuilders with a single variable

Open YongGoose opened this issue 1 year ago • 1 comments

Summary

  • Extending MatcherOperator for improved ArbitraryBuilder management

(Optional): Description

  • Implementing a new subclass of MatcherOperator with an active boolean field to dynamically manage selection states based on user input
  • initializing active as false in giveMeBuilder and updating it in selectName method when names match.

How Has This Been Tested?

  • existing tests

Is the Document updated?

No needed

YongGoose avatar Oct 16 '24 00:10 YongGoose

@seongahjo 성아님! 한 가지 상의해볼 내용이 있어 코멘트 남깁니다.

이번 구현은 MatcherOperator를 상속받은 새로운 클래스를 통해 구현했습니다. 선택 여부를 관리하기 위해 active라는 boolean 필드를 추가했으며, 동작 방식은 하기와 같습니다.

  • giveMeBuilder 메서드에서 active 필드를 false로 초기화한 후, selectName 메서드에서 입력된 이름과 비교를 수행합니다.
  • 이름이 일치할 경우 active 필드를 true로 변경하여, 사용자의 입력에 따라 선택 상태가 동적으로 관리되도록 했습니다.
  • match 메서드에서 상위 클래스의 matchactive 여부를 통해 식별 합니다.
return active && super.match(property);

이때 초기화 하는 위치는 selectName의 여부와 상관 없이 초기화를 하기 위해 giveMeBulider에서 초기화를 했습니다.

selectName API를 호출하지 않는 경우, giveMeOne을 통해 생성하는 경우등 RegisteredName을 통해 등록한 register 연산이 다음 객체 생성에 영향을 미치지 않도록 했습니다.


저번 PR에서 성아님께서 (name, Property)로 식별을 하라고 하셨는데 (active, property)를 통한 식별 방식이 괜찮은지 성아님의 의견이 궁금합니다. 그리고 초기화 하는 위치도 한 번 검토 부탁드립니다!

만약 더 좋은 아이디어가 있으시다면 공유 부탁드립니다🙂

YongGoose avatar Oct 16 '24 01:10 YongGoose

PR이 좀 길어지고 있긴 한데, 같이 논의하면서 기능이 좋은 방향으로 발전을 해나가는 것 같습니다. 👍

seongahjo avatar Nov 02 '24 13:11 seongahjo

코드 정리만 마무리 하고 다음 PR 작업을 해도 좋을 것 같습니다!

코드 정리 완료했습니다. 확인 부탁드립니다! 다음 PR에서는 register 연산 임의로 정하는 것과 우선순위 기능에 대해 작업을 해보겠습니다!

감사합니다.☺️

YongGoose avatar Nov 08 '24 05:11 YongGoose