Difference between revisions of "Class identifier"

From DocDataFlow
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 3: Line 3:
 
Many of the Crawler concepts map directly onto underlying object classes.  
 
Many of the Crawler concepts map directly onto underlying object classes.  
  
For example, every [[Adapter|''adapter'']] type, every [[Granule|''granule'']] type, every [[Granule sort|''granule sort'']]... is programmatically represented by an object class.
+
For example, every [[Adapter|''adapter'']] type, every [[Granule|''granule'']] type, every [[Granule Ordering|''granule ordering'']]... is programmatically represented by an object class.
  
For [[Granule|''granules'']] and [[Granule sort|''granule sorts'']], these underlying object class are assigned a unique alphanumerical identifier, called the 'class identifier'.  
+
For [[Granule|''granules'']] and [[Granule Ordering |''granule orderings'']], these underlying object class are assigned a unique alphanumerical identifier, called the 'class identifier'.
 +
 
 +
These class identifiers are 'reverse domain names': by taking an existing domain name (rorohiko.com), reversing it, and add a number of period-separated strings to it, we can create identifiers that can be nearly certainly unique. Other companies using Crawler can define class identifiers that are guaranteed to be different from any other company's class identifiers as long as they stick to this 'reverse domain name' rule, and take some care in the choice of the identifiers.
  
 
There are many granule types; some examples:
 
There are many granule types; some examples:
Line 13: Line 15:
 
* ...
 
* ...
  
Another example. These are two predefined granule sort class identifiers:
+
Another example. These are two predefined [[Granule Ordering |''granule ordering'']] class identifiers:
 
* com.rorohiko.ordering.frame.vertical
 
* com.rorohiko.ordering.frame.vertical
 
* com.rorohiko.ordering.frame.horizontal
 
* com.rorohiko.ordering.frame.horizontal
  
These class identifiers are 'reverse domain names': by taking an existing domain name (rorohiko.com), reversing it, and add a number of period-separated strings to it, we can create identifiers that can be nearly certainly unique. Other companies using Crawler can define class identifiers that are guaranteed to be different from any other company's class identifiers as long as they stick to this 'reverse domain name' rule.
+
In Crawler's [[Configuration File|''config files'']], it is often necessary to refer to specific object classes. That's where these class identifiers come in: they are a convenient way to refer to the use of a particular [[Granule|''granule'']] type or [[Granule Ordering |''granule ordering'']] in a text based [[INI file]].
 
+
In Crawler's [[Configuration File|''config files'']], it is often necessary to refer to specific object classes. That's where these class identifiers come in: they are a convenient way to refer to the use of a particular [[Granule|''granule'']] type or [[Granule sort|''granule sort'']] in a text based [[INI file]].
+
  
 
There is also a short-hand notation.  
 
There is also a short-hand notation.  

Latest revision as of 04:16, 28 December 2013

Crawler is built using object-oriented programming techniques.

Many of the Crawler concepts map directly onto underlying object classes.

For example, every adapter type, every granule type, every granule ordering... is programmatically represented by an object class.

For granules and granule orderings, these underlying object class are assigned a unique alphanumerical identifier, called the 'class identifier'.

These class identifiers are 'reverse domain names': by taking an existing domain name (rorohiko.com), reversing it, and add a number of period-separated strings to it, we can create identifiers that can be nearly certainly unique. Other companies using Crawler can define class identifiers that are guaranteed to be different from any other company's class identifiers as long as they stick to this 'reverse domain name' rule, and take some care in the choice of the identifiers.

There are many granule types; some examples:

  • com.rorohiko.granule.indesign.color
  • com.rorohiko.granule.folder
  • com.rorohiko.granule.text.word
  • ...

Another example. These are two predefined granule ordering class identifiers:

  • com.rorohiko.ordering.frame.vertical
  • com.rorohiko.ordering.frame.horizontal

In Crawler's config files, it is often necessary to refer to specific object classes. That's where these class identifiers come in: they are a convenient way to refer to the use of a particular granule type or granule ordering in a text based INI file.

There is also a short-hand notation.

For granules, the prefix 'com.rorohiko.granule.' can be dropped, so in INI file entries where a granule type is expected, the entries

com.rorohiko.granule.text.word
text.word

are equivalent.

For granule sorts, the prefix 'com.rorohiko.ordering.' can be dropped, so in INI file entries where a granule ordering is expected, the entries

com.rorohiko.ordering.frame.vertical
frame.vertical

are equivalent.