+
Skip to content

Rename isabstract method #803

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

PrasannaPal21
Copy link

Fixes #482

Renamed misleading isAbstract method to hasSubclasses to accurately reflect what it does - checks if a class has child classes. The old method name conflicted with Pharo's standard meaning and caused confusion.

Changes Made

  • Created new hasSubclasses method with improved implementation
  • Made old isAbstract method deprecated but still working
  • Updated all references in CMAbstractModel class
  • Added proper tests for the new functionality

Benefits

This change makes the code more intuitive while maintaining compatibility with existing code. Developers can now better understand class hierarchy operations in Cormas without confusion about what "abstract" means in this context.

Testing Code

The changes were tested using these Playground snippets:

"Test 1: Testing the hasSubclasses method directly"
CMEntity hasSubclasses.  "Should return true"
CMInstanceParameter hasSubclasses.  "Should return false"
CMEntity isAbstract.  "Should return true but show deprecation warning"
"Get the model instance"
model := CMMockModel new.

"Test allTheEntities: method with a class that has subclasses"
model allTheEntities: CMEntity.

"Test entitiesOfClass: with a class that has subclasses (should return empty collection)"
model entitiesOfClass: CMEntity.

"Test with a concrete class that doesn't have subclasses"
"Replace ConcreteEntityClass with an actual concrete entity class from your model"
model entitiesOfClass: CMInstanceParameter. 
CMEntityTest new testCormasEntityHasSubclasses.
CMEntityTest new testCormasEntityIsAbstract.

olekscode and others added 7 commits March 24, 2025 14:24
Pharo13.0.0:
#Branch: master Fixes #
#Please use one of those
#feat:
#fix:
#refactor:
#chore:
#comment: renamed  "ESE(regular) - special location" to "accessing cells" and the protocol "ESE initialize- release" contains 3 methods: createCells, initializeRegularNumberOfRows: numberOfColumns: neighbourhood: closed: and numberOfNeighbours - all of them moved to "initialization" protocol.
Removed CMAVerage150to500ValueCollector class
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.

4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载