السلام عليكــم ورحمـة الله وبركاتــه ،،
- المرحلة الأولى : تطوير وحدة ( حزمة) I/O.
- الهدف : تطوير أصناف Classes مسؤولة عن القراءة والكتابة من و إلى مستودع بيانات ( ملفات - الذاكرة .. الخ ) .
- أصناف ( Classes ) هذه المرحلة ومواصفات ( Specification ) كل صنف :
( تحت التطوير )
- خطوات التطوير:
(جميع اللغات البرمجية يتم مناقشتها في هذا الموضوع بما في ذلك الخطوة الثالثة و الرابعة)
- التحليل الأولي للموضوع :
- نناقش فائدة هذه الحزمة 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 .
- اختبار الكود .
