[Gambas-user] The Class keyword

B Bruen bbruen at ...2308...
Sat Jul 5 23:51:29 CEST 2014


Ah, now I get it!
Thanks Tobi

B


On Fri, 27 Jun 2014 11:42:06 +0200
Tobias Boege <taboege at ...626...> wrote:

> On Fri, 27 Jun 2014, B Bruen wrote:
> > As in :
> > CLASS Identifier
> >    Declares to the compiler that Identifier can be used as a class name.	
> > 
> > I am unsure of what this keyword really achieves.  Specifically, I am having trouble understanding the help paragraph:
> > "This keyword can be useful if you want to write some optional code in a component that needs a class from a component that is not necessarily loaded by the main project using this component."
> > 
> 
> Suppose you implement a Graph class in gb.data which uses an adjacency
> matrix. So you have the normal graph stuff in the interface but also maybe
> a Matrix property that is specific to the Graph implementation via an
> adjacency matrix - and this property returns that matrix.
> 
> This is actually useful because you may want to do arithmetic on this matrix
> to find connected components, the number of triangles in the graph, etc..
> 
> However, you would want the datatype of the Matrix property to be the Matrix
> class of gb.gsl or the like so that users can readily operate on it. But you
> may also notice that some users don't really care about the matrix - they
> just want *some* graph or adjacency matrices scale well in their application
> - and are bothered by the dependency of gb.gsl you have just imposed.
> 
> Therefore, leave gb.gsl out and use "Class Matrix" in your Graph class.
> Those users who want to use the Matrix property will have to load gb.gsl
> themselves and everyone is happy.
> 
> Regards,
> Tobi
> 
> -- 
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> 
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


-- 
B Bruen <bbruen at ...2308...>




More information about the User mailing list