السلام عليكــم ورحمـة الله وبركاتــه ،،
- المرحلة الأولى : تطوير وحدة ( حزمة) core .
- الهدف : تطوير أصناف Classes أساسية للمحرك مثل أصناف رياضية Mathematical Classes .
- أصناف ( Classes ) هذه المرحلة ومواصفات ( Specification ) كل صنف :
- Math
- Point2D
- Line2D
- Rectangle
- Circle
- Triangle
- Polygon
- Vector2D
- Matrix3
- Random
- كل الأصناف السابقة هي Classes لاتوجد بينها أي علاقة Relationship .
- لغة الجافا : يمكن تجاهل الكلاس Math لوجوده بشكل افتراضي
- للمراجعة في وقت لاحق :
Point2D vs Vector2D !
Boost and C++ implementation !
Triangle and Polygon in 0.1 version !
- خطوات التطوير:
(جميع اللغات البرمجية يتم مناقشتها في هذا الموضوع بما في ذلك الخطوة الثالثة و الرابعة)
- التحليل الأولي للموضوع :
- نناقش فائدة هذه الحزمة core , وماهو الهدف منها .
- هنا تبدأ تتضح معالم Classes و Interfaces و Enumerations التي سنحتاجها .. والعلاقات بين الكلاسات Classes . - كتابة مواصفات Specification للأصناف Classes التي سيستخدمها المستخدم النهائي :
نختار جزء معيّن من الأصناف والواجهات Classes - Interfaces ، التي ستظهر للمستخدم النهائي , ونكتب مواصفاتها بالتفصيل , بحيث يمكن لأي مطوّر دعم هذه الأصناف والواجهات في أي لغة برمجية يريد ، مثال ( يجب اتباع طريقة كتابة المواصفات قدر الامكان ) :
// Interface that read an image from specific file into ImageBuffer
ImageReader <interface>
{
/// @Purpose : load an image from specific file and create new object of ImageBuffer
/// that holds image info .
/// @Parameters:
/// - fileName : image file name ( full path ) .
/// @return :
/// on success :new ImageBuffer object holds image info
/// on failure : NULL;
/// @Exceptions :
/// FileNotFoundException if the image (fileName) does not exist .
/// FileFormatNotSupportedException if the image format is not supported.
[byRef] ImageBuffer read( [iN] string fileName) <pure>
};
مثال اخر :
// Class used to hold an image information such as ( width - height - format - data)
ImageBuffer<class>
{
// array of char that contains image data (colors).
byte [ ] data
// image width
int width
// image height
int height
// bits per pixel
int bpp
// @Purpose : check if the image has alpha channel
// @return :
// true : if the image has alpha channel
// false : otherwise
[byValue] bool isAlpha().
};
- لا يتم كتابة مواصفات الدوال Methods و الأعضاء Members الشائعة مثل Setters و Getters .. مثال : setText . - مناقشة الخوارزميات والأفكار وكتابة الكود Implementation .
- اختبار الكود .



