Beruflich Dokumente
Kultur Dokumente
_endmethod
To access area method in circle class,type circle.area(2) at mag
iksf prompt as shown below
MagikSF> circle.area(2)
$
12.57142857
ALL INTER VIEW QUESTIONS
Which method is used to generate id value?
make_sysid().
Posted by shreeLakshmi Poluru at 09:07 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
How to add enumerators values without using the case tool?
Using extensible enumerator.
Posted by shreeLakshmi Poluru at 09:06 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
How can we add indices to collection using magik code?
Add_index() and drop_index() methods are used to add and remove indices from col
lection.
Posted by shreeLakshmi Poluru at 09:05 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
What is the difference between the detached record and template record?
Both detached record and template record returns an object which has same fields
and behavior of collection record but it is not an element of collection.
In detached record ,fields are not initialized with default value whereas in tem
plate record fields are initialized with default values.
Creating detached record is faster than the template record.
Posted by shreeLakshmi Poluru at 09:04 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
Elements() vs fast_elements()
Elements() returns only valid records.
If we are using fast_elements() on the collection in which the records are inser
ting and deleting, then fast_elements() returns the deleted records also.
Posted by shreeLakshmi Poluru at 09:03 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
When do we get stale record handle?
If user tries to refer the deleted object, then stale record handle error will ra
ises.
Posted by shreeLakshmi Poluru at 09:01 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
smallworld database is which type of database?
Smallworld database is relational databse.
Posted by shreeLakshmi Poluru at 09:00 Email ThisBlogThis!Share to TwitterShare
to FacebookShare to Pinterest
Labels: interview questions, Magik, smallworld
Thursday, 19 February 2015
What are the different kinds of objects available in magik?
In Magik there are distinct formats for different kinds of object:
enumerated: objects that have no data, such as integers and Booleans
indexed: objects that have numbered elements
slotted: objects with named fields called slots
EX:
_abstract _method hash_helper.match?(thing1, thing2)
## Returns a boolean which is true if thing1 and thing2 should
## be regarded as the same
## Subclasses must provide an implementation of this method
_endmethod
def_slotted_exemplar(:square,
{})
$
_method square.new()
>> _clone.init()
_endmethod
$
_method square.init()
_return _self
_endmethod
$
_method square.area(r)
area << r*r
_return area
_endmethod
To access area method in circle class,type circle.area(2) at mag
iksf prompt as shown below
MagikSF> circle.area(2)
$
12.57142857
1 What are the different kinds of objects available in magik?
In Magik there are distinct formats for different kinds of object:
enumerated: objects that have no data, such as integers and Booleans
indexed: objects that have numbered elements
slotted: objects with named fields called slots
2)What are the different kinds of objects available in magik?
In Magik there are distinct formats for different kinds of object:
enumerated: objects that have no data, such as integers and Booleans
indexed: objects that have numbered elements
slotted: objects with named fields called slots
3) How to generate magik compile file?
Magik compile file is generated using following command
magik_rep.compile_file(file_path )
<file_path>: give file full path
EX:
magik_rep.compile_file( D:\test.magik )
After executing the above statement test.magikc file is generated in the D:\
4) Name some executable files present in product bin directory? is user has dire
ct access to these files?
Sw_magik,sw_magik_win32,swdocopen,swsleep etc.,
Yes, user has direct access to these files
5) Which executable file is used to start a session on windows?
Sw_magik_win32 is used to start a session with graphics on the windows.
Along with this, there are other two executable files.
1. sw_magik for a session with no graphics.
2. sw_magik_motif for a session with graphics via the motif window system on uni
x computers.
6) Smallworld application supports which n-tier architecture?
Smallworld application supports 3-tier architecture.
1.
Database server layer
2.
Application engine layer.
3.
User interface layer.
6) Method Definitions
Functionality of the objects are defined in the methods. Methods are invoked by
sending message to the objects.
Methods can be defined in the following forms:
Standard method definition:
[_private]
_method <receiver> . <message> [ (<arguments>) ]
<block body>
_endmethod
<receiver> is the name of the class. <message> is the name of the method. <argum
ents> is the list of arguments.
If the keyword _private is present, that method can be accessed within the same
class and subclasses.
EX:
_method integer.odd_even()
_if _self.odd?
_then write("This is an odd number")
_else write("This is an even number")
_endif
_endmethod
Method with brackets is different from the same method name without brackets.
Odd_even() is different from odd_even.
Field Access method definition:
[_private]
_method <receiver> . <message>
<block body>
_endmethod
<receiver> is the name of the class. <message> is the name of the method.
EX:
_method association.key
>> .key
_endmethod
Usually,field access methods are used to return slot value.
Indexing method definitions:
[_private] _method <receiver>'[' <argument list> ']'
<block body>
_endmethod