User classes

Info about design forms features
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1107: count(): Parameter must be an array or an object that implements Countable
PetrS
Site Admin
Posts: 181
Joined: 11 Jul 2014, 13:55
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1107: count(): Parameter must be an array or an object that implements Countable

User classes

Postby PetrS » 16 Jul 2014, 06:42



User class is object consisting of properties and methods.

In OOP, you use objects=classes in your programs to encapsulate the data associated with the entities with which the program is working. For example, a human resources application needs to work with employees. Employees have attributes associated with them that need to be tracked - names, addresses, departments, and so on. Although you track the same attributes for all employees, each employee has unique values for these attributes.

Along with the properties you also need an established set of behaviours exposed by object (class). For example, one employee behaviour of interest to the human resources department is the ability to request time off. The Employee object contains a RequestTimeOff method that encapsulates the necessary code.

A class enables you to create your own custom types by grouping together variables of various types and methods. A class is like a blueprint. It defines the data and behavior of a type. You can use it by creating instance which are assigned to a object variable.

UserClass declaration:
class <Class_Name> {
<Class_Properties>
<Class_Methods>
}

Initialise:
object <Varianble_Name> = new <Class_Name>();

Use:
User class can be used to encapsulated logic block of properties (values) and functions.
You can create multiple instances of one class type to make script clear, readable and more efficient.

See also:
url=http://msdn.microsoft.com/en-us/library/vstudio/x9afc042.aspxMSDN online help/url.
Attachments
Class.cls
(40.98 KiB) Downloaded 306 times
Ing. Petr Slepicka

Engineering calculations online - EuroCode, AISC, statics
Automate your static calculations today!

PetrS
Site Admin
Posts: 181
Joined: 11 Jul 2014, 13:55
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1107: count(): Parameter must be an array or an object that implements Countable

Re: User classes

Postby PetrS » 08 Dec 2014, 10:53

Attachments
Class constructors.cls
(23.32 KiB) Downloaded 292 times
Ing. Petr Slepicka

Engineering calculations online - EuroCode, AISC, statics
Automate your static calculations today!


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1107: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1107: count(): Parameter must be an array or an object that implements Countable

Return to “Design forms features”

Who is online

Users browsing this forum: No registered users and 2 guests