The key point here is to create Virtual Tables (xxx_vtables) in which you can have the chance to use pointer to function"const char* (*sound)();"}#includestruct animal_vtable { const char* (*sound)(); }; struct animal { struct animal_vtable methods; const char* name; }; const char* cat_sound() { return "meow!"; } const char* dog_sound() { return "bark!"; } void describe(struct animal *a) { printf("%s makes \"%s\" sound.\n", a->name, a->methods.sound()); } struct animal cat = {{&cat_sound}, "cat"}; struct animal dog = {{&dog_sound}, "dog"}; int main() { describe(&cat); describe(&dog); return 0; }
Unified Modeling Language (UML) is a standardized general-purpose modeling language in the field of software engineering.. In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design.
Search This Blog
Showing posts with label OOP. Show all posts
Showing posts with label OOP. Show all posts
Tuesday, June 25, 2013
polymorfism in ANSI C
Friday, June 21, 2013
Principle Inversion of Control
In software engineering, inversion of control (IoC) is a programming technique, expressed here in terms of object-oriented programming, in which object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis.
http://www.c-sharpcorner.com/UploadFile/akkiraju/dependency-injection-techniques-explained-part-1/
In object-oriented programming, there are several basic techniques to implement inversion of control. These are:
- using a factory pattern
- using a service locator pattern
- using a dependency injection, for example:
- a constructor injection
- parameter injection
- a setter injection
- an interface injection
- using a contextualized lookup
http://www.c-sharpcorner.com/UploadFile/akkiraju/dependency-injection-techniques-explained-part-1/
Wednesday, June 19, 2013
Subscribe to:
Posts (Atom)
Blog Archive
About Me
- Grigorios Agathangelidis
- An seasoned developer, architect and with some Team Leading exposure, offering full project life cycle experiences within multi cultural, multi National environments and within differing business streams and all primarily on a .Net platform.