# Where to define common methods on a row?

  1. To define commonly used methods on a row, extend the row using the keyword extend on a collection in .kmongo.

    For example:

     




    collection Employee extend {
    	property name:String
    	...
    }
    
  2. run command compile

  3. define the methods in the generated RowExtn class





     


    trait EmployeeRowExtn extends EmployeeRowExtnTrait {
      row: EmployeeRow =>
      override lazy val age: Int = { ... }
      
      def isSenior:Boolean = row.designation == "Manager"
    }