Comments (12)
In Pharo, the convention is to use 3 (or 4) prefix letters in order to distinguish classes. For example, Glamour classes are prefixed with GLM, Roassal 2 with RT, ...
Bu some packages are not following this convention, for examples you can find a lot of MOOSE classes, who start with MooseXXX.
For core CORMAS classes, we should find prefix all classes with Cormas or if this is long by COR.
For case2, I have no other idea at the moment, than prefixing classes with model name.
For case 3, yes we have to use the Ring API: https://hal.archives-ouvertes.fr/file/index/docid/629677/filename/Uqui11a-RingJournalPaper-CSSJournal.pdf
from cormas.
Hi,
I am very surprised that no NameSpace or equivalent (eg Package) exist in Pharo ...
Eg, Java allows us to group classes in packages to facilitate modularity. The same goes for VW.
Then one accesses to a class by its absolute path (/Users/bommel/vw7.6nc/cormas/Models/VarzeaViva that is ugly), or by classPath (in Java) and a parcelPath (in VW).
Do Package or Category of Pharo offer a similar mechanism?
Because it would be too bad to have very long class names...
from cormas.
There is some experiments done by Pharo developers to introduce NameSpace in Pharo, but at the moment the dev are not satisfied. I guess they will introduce a namespace framework in Pharo 6.0 or 7.0. We can ask @Ducasse for advice here.
from cormas.
On 30 May 2015, at 12:28, Serge Stinckwich [email protected] wrote:
There is some experiments done by Pharo developers to introduce NameSpace in Pharo,
for the moment just flatten it
ie
Cormas.Model
CSModel
I hope that you do not use the class level namespace import of vw because it is a bad idea.
but at the moment the dev are not satisfied. I guess they will introduce a namespace framework in Pharo 6.0 or 7.0. We can ask @Ducasse for advice here.
—
Reply to this email directly or view it on GitHub.
Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
03 59 57 78 50
03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
from cormas.
We will do something like that for CORMAS Core class, maybe using the COR prefix.
The problem is for models developed by end users. For example, there is a lot of Farmer classes. If we load two models at the same time, the classes names will clash.
But this is not an important matter. We can deal with that at the moment ;-)
from cormas.
You see namespaces do not solve this problem at all. They give the illusion but in really you have to disambiguate too.
You will have to either generate one namespace per user so you can do the same ie: US12Farmer.
Or I missed something obvious.
Stef
We will do something like that for CORMAS Core class, maybe using the COR prefix.
The problem is for models developed by end users. For example, there is a lot of Farmer classes. If we load two models at the same time, the classes names will clash.
But this is not an important matter. We can deal with that at the moment ;-)—
Reply to this email directly or view it on GitHub.
Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
03 59 57 78 50
03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
from cormas.
At the moment, CORMAS end-users (people who built models and not necessarily computer scientists) use a mix of specific tools and VW tools. For example, if you want to develop a new Farmer class, you create your class with a CORMAS entities browser and after that when you add methods, you use the class Browser from VW.
We will have to find a way to prefix the user classes or to have some specific CORMAS Browser.
from cormas.
Yes in Cormas VW, a namespace is created for each new model. Then each user can create his own "Farmer" class (from a specific tool) and there is no ambiguity with the Farmer of other models.
Each class can be called from its absolute name (the complet path), but because a parcelPath is defined for each model, the user can just call 'Farmer' to access to it.
If it isn't possible to have this kind of mechanism, no problem to use prefix, for the moment. But for the futur, it will be better to find a way to use a kind of class path, as the modelers want to deal with 'Farmer' instead of 'CorVarzeaVivaFarmer' :)
from cormas.
Ok, we will prefix every classes of Cormas with the CM prefix and classes of a model with the name of the model. For example for Conway model, we will have :
- CMConway
- CMConwayCell
from cormas.
OK, let do it this way for now.
I hope the next version of Pharo will offer namespaces, because for an end-user it is obviously simpler to define his class as "Farmer" instead of "CMVarzeaVivaFarmer", especially when we work into a participatory process involving non-scientific stakeholders. For example, the class diag. editor developed by Peter will be used with real farmers (I hope) to collectively design models that everyone can understand and take ownership. The entity names must therefore remain understandable to all.
from cormas.
On 31 Mar 2016, at 18:42, Pierre Bommel [email protected] wrote:
OK, let do it this way for now.
I hope the next version of Pharo will offer namespaces, because for an end-user it is obviously simpler to define his class as "Farmer" instead of "CMVarzeaVivaFarmer", especially when we work into a participatory process involving non-scientific stakeholders. For example, the class diag. editor developed by Peter will be used with real farmers (I hope) to collectively design models that everyone can understand and take ownership. The entity names must therefore remain understandable to all.
But you end user can use a UI and this is the job of the UI to check and generate correct class names.
Namespaces are not something that you simply add in any language and now in Pharo it would mean a huge effort.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #17 (comment)
Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
03 59 57 78 50
03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
from cormas.
Decision: for the moment, no namespace in Pharo. So, we keep the Pharo convention for now.
from cormas.
Related Issues (20)
- Remove the unloadPackages method from the baseline
- Make entity creating faster by building the getter only once
- Make pluralization faster and remove the singleton from CMEntity class >> asGetterForEntityClass
- Add Pharo 10, 11, 12 to the baseline of Cormas-Core
- Rename CMResourceLocatorTest to CMGitBridgeTest
- Use juliendelplanque/PharoCodeGenerator to generate model's creationDate method
- Simplify the CMGitBridge
- CMModel does lot record the probes data HOT 3
- Rename initSimulation to initializeSimulation
- Replace Agent subclasses with traits
- Remove CMLocatedAgent >> logMovementTo:
- Remove deprecated methods from CMLocatedAgent
- Remove CMCommunicatingAgent >> agentObs and agentObs:
- Rename isAgentComm to isCommunicating
- Rename all sendSynchronouslyMsg* and sendAsynchronouslyMsg* to *Message in TCMCommunicating
- Remove TCMCommunicating class >> isAgentCommClass
- Rename TCMLocated >> isClassLocation to isLocated
- Rewrite CMSpecAgentAddInterface >> entitySuperclass
- Remove CMCommunicatingAgent >> acquaintances and acquaintances:
- Write tests for TCMCommunicating
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cormas.