Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[epsilon-dev] Proposal to add isLoaded() to IModel

Hi everyone,

 

I’ve been thinking of adding an isLoaded() method to IModel to determine whether the load() method has been called. As a first step I’ve gone through all EMC drivers that I could find to see how it would work by implementing the method, and without any exception all implementations have been trivial. Every model has an underlying resource which is initialized or mutated when load is called. Therefore the implementation of isLoaded() is, in every case I have encountered, a simple null check. Infact the most “complex” case is AbstractEmfModel, which is still a one-line _expression_:

 

public boolean isLoaded() {

    return modelImpl != null && modelImpl.isLoaded();

}

 

Since this is a low-effort method to implement and appears to be very generalisable, combined with the upcoming 2.0 release, I propose to make this an abstract method in IModel.

 

Thanks,

Sina

 

 


Back to the top