Overview of lecture series ♦ Background ♦ Introduction to Szumo ♦ Case study ♦ Semantic and implementation details ♦ Related concurrency models ♦ Ongoing and future work Laser 2005 - Summer School on 1 Software Engineering
Goal Validate the efficacy of Szumo to current software engineering practice – Is Szumo sufficiently expressive to handle designs of complex systems? – Is Szumo effective in localizing synchronization concerns? – Can Szumo support use of modern OO design techniques ( e.g. structural modeling notations, design patterns)? Laser 2005 - Summer School on 2 Software Engineering
Approach ♦ Designed and implemented a multi-threaded OO web server – Modeled after Apache – Exemplar of realistic multi-threaded OO design ♦ Tested extensibility/maintainability by adding different types of features – Authentication – Dynamic content generation – Load balancing Laser 2005 - Summer School on 3 Software Engineering
Overview of lecture series ♦ Background ♦ Introduction to Szumo ♦ Case study – A contract-aware web server – Extension tasks ♦ Semantic and implementation details ♦ Related concurrency models ♦ Ongoing and future work Laser 2005 - Summer School on 4 Software Engineering
Aside on a change in terminology ♦ Yesterday, I used processes and threads as synonyms ♦ Today, I need to distinguish between them – Process : program running in its own data space (OS process) – Thread : locus of control within a process (lightweight “process”) Laser 2005 - Summer School on 5 Software Engineering
Web server design: Motivating Example Authentication Content Generation Finalization Encryption Libraries Content Handlers Logging & Statistics Laser 2005 - Summer School on 6 Software Engineering
Web server design: Motivating Example dispatches web server main Authentication Content Generation Finalization Encryption Libraries Content Handlers Logging & Statistics Laser 2005 - Summer School on 7 Software Engineering
Web server design: Motivating Example dispatches web server main Authentication Content Generation Finalization dispatches Encryption Libraries Content Handlers Logging & Statistics Authentication Content Generation Finalization Encryption Libraries Content Handlers Logging & Statistics Laser 2005 - Summer School on 8 Software Engineering
Web server design: Motivating Example dispatches web server main Authentication Content Generation Finalization dispatches Encryption Libraries Content Handlers Logging & Statistics Authentication Content Generation Finalization Laser 2005 - Summer School on 9 Software Engineering
Web server design: Motivating Example dispatches web server main Authentication Content Generation Finalization dispatches Encryption Libraries Content Handlers Logging & Statistics Authentication Content Generation Finalization Laser 2005 - Summer School on 10 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 11 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 12 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 13 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 14 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 15 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 16 Software Engineering
Web server design: Motivating Example r1: request_handler <<process root>> <<dispatches>> a1: authenticator c1: content_generator f1: finalizer : web_dispatcher :req_handler_pool : crypt : content_handler : logger <<process root>> <<dispatches>> a2: authenticator c2: content_generator f2: finalizer r2: request_handler <<process root>> Laser 2005 - Summer School on 17 Software Engineering
Basic web-server design << p proc rocess ess root > root >> WEB_DISPATCHER liste lis tene ner pool poo start sta rt_r _requ equest st: B : BOOLEA OOLEAN REQUEST_HANDLER_POOL { listener, handler hand start_request => pool } pool poo { terminating => pool, * * * * content_stage => dispatcher, << p proc rocess ess root > root >> LISTENER_SOCKET connect conne ction ion finishing => finalizer, INBOUND_SOCKET REQUEST_HANDLER auth_stage => authenticator, sta start rt_up _up: BOOL BOOLEAN EAN termin te rminat atin ing: BOOLEA BOOLEAN . . . } { start_up=> name_svr} name name_svr content content_stage: B BOOLEA OOLEAN finish shin ing: B BOOLEA OOLEAN au auth th_st _stage: BO BOOLEAN AN authent authenticato tor . . . . . . << ext << exter ernal > al >> NAME_SERVICES dis ispat finalizer fin atche AUTHENTICATOR cher zer { curr_auth } { processor } curr_auth cur auth_lis SESSION_MANAGER CONTENT_DISPATCHER FINALIZER _list auth hdlr_selected: BOOLEAN * prsr_l prs pro processor { hdlr_selected => handler hand * VALIDATOR _list essor handler } SESSION_OPERATION * * CONTENT_HANDLER POST_PROCESSOR SESSION Laser 2005 - Summer School on 18 Software Engineering
Overview of lecture series ♦ Background ♦ Introduction to Szumo ♦ Case study – A contract-aware web server – Extension tasks ♦ Semantic and implementation details ♦ Related concurrency models ♦ Ongoing and future work Laser 2005 - Summer School on 19 Software Engineering
Extension tasks ♦ Task 1: Authentication – Added authentication capability – Safely integrated library functions ♦ Task 2: Dynamic content generation – Provided for user scripting in the same memory space as the web server ♦ Task 3: Load balancing – Modified web server to dynamically adapt the number of content generators as a function of load Laser 2005 - Summer School on 20 Software Engineering
Extension tasks ♦ Task 1: Authentication – Added authentication capability – Safely integrated library functions ♦ Task 2: Dynamic content generation – Provided for user scripting in the same memory space as the web server ♦ Task 3: Load balancing – Modified web server to dynamically adapt the number of content generators as a function of load Laser 2005 - Summer School on 21 Software Engineering
Task 1: Authentication Purpose: Provide authentication capability ♦ PWD_VALIDATOR: invokes POSIX library’s “crypt” function to validate password ♦ DB_VALIDATOR: uses a third party database engine (which also invokes “crypt”) to authenticate user AUTHENTICATOR { curr_auth } curr_auth Convention: We auth_list show existing * classes and VALIDATOR associations in blue and new ones in black PWD_VALIDATOR DB_VALIDATOR Laser 2005 - Summer School on 22 Software Engineering
Recommend
More recommend