Given a class in OOP, shall I add the related methods signatures or not?
이전 댓글 표시
I have a class BB, with properties and methods. It is defined in its own folder @BB. The methods are all defined in separate files .m within the folder. I have already read all the relative documentation.
Reading the documentation, it says, I should report in the BB class the methods signatures, as follows:
classdef BB < handle
properties
...
end
methods
function bb = BB( phy ) % Constructor
...
bb = set_resource_map( bb );
end
% the signatures of dynamic methods must be reported here
bb = set_resource_map( bb );
end
methods (Static)
% the signatures of static methods must be reported here
tags = tag_1D( indexes1d, tag_number );
end
end
Now the question is:
The class works also without reporting method signature as follows. Is it fine?
% the signatures of dynamic methods must be reported here
bb = set_resource_map( bb );
The Class does not work, instead, without reporting the static method signature, as follows. Is it fine?
% the signatures of static methods must be reported here
tags = tag_1D( indexes1d, tag_number );
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Software Development에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!