Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC509 Lecture 08

CSC509 Lecture 08

Software Design
Software Product Lines
(202410)

Javier Gonzalez-Sanchez

October 23, 2024
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 508/9 Software Engineering (Design & Deployment) Lecture 08. Software Product Line
  2. De f inition • A softw a re product line

    (SPL) is a collection of softw a re systems th a t sh a re common fe a tures a nd a re developed from a single set of core a ssets: • Go a l. The go a l of a n SPL is to cre a te multiple products with less development e ff ort by reusing the development e ff ort put into gener a l components a nd services. 2
  3. Feedback • Do not cre a te objects from a

    Bl a ckbo a rd. It is a Singleton for a re a son • Use inherit a nce for PropertyCh a ngeSupport • Do not m a ke a cl a ss observer of itself - it is wired! • Be more selective with your glob a l v a ri a bles ( a tributes). Remember the de f inition of a ttribute • Ask: Wh a t this cl a ss does? C a n you a nswer in a simple st a tement. • Cle a n your code - do not commit (submit) unused methods or commented code or sever a l empty lines. It provides a b a d impression. 7
  4. Clean Code Re a d a bility • DRY •

    KIS • SRP • Comments • Error H a ndling with a Logger 8 Metrics • LOC (eLOC, lLOC) • CC • A • Inst a bility • D
  5. • The project object model (POM) f ile describes a

    project a nd its dependencies. • A st a nd a rdized directory form a t. • Repositories where third-p a rty softw a re is stored a nd discovered. 11
  6. Logging • Recording events, a ctions, or mess a ges

    th a t occur during the execution of a progr a m. • Proper logging is essenti a l for m a int a ining a nd troubleshooting a pplic a tions e ff ectively throughout their lifecycle. 22
  7. SLF4J Logback • St a nds for Simple Logging F

    a c a de for J a v a • It provides a uni f ied interf a ce for logging oper a tions, a llowing developers to write logging code without binding their a pplic a tion to a speci f ic logging implement a tion. 24
  8. We want this 29 message 01 message 02 message 03

    message 04 message 05 trace() debug() info () warn () error() Logger 29
  9. Resources Folder • The resources folder in a M a

    ven project stores non-source-code f iles th a t your a pplic a tion needs, such a s con f igur a tion f iles, property f iles, im a ges, a nd other resources. • These f iles a re included in the f in a l build output a nd a v a il a ble on the cl a ssp a th a t runtime. 31
  10. src/main/resources/logback.xml • logb a ck.xml is a con f igur

    a tion f ile for SLF4J Logb a ck. • It de f ines how logging should be h a ndled, including log levels, a ppenders (where logs a re written), a nd log form a ts. • When your a pplic a tion st a rts, SLF4J Logb a ck a utom a tic a lly looks for this con f igur a tion f ile. 32
  11. ConsoleAppender 35 message 01 message 02 message 03 message 04

    message 05 trace() debug() info () warn () error() Logger 35 Appender
  12. Logstash Logback Encoder | POM.xml • Let’s use a nother

    libr a ry to t a ke a dv a nt a ge of extr a encoders • form a t Spring Boot logs in JSON form a t 37 https://github.com/CSC3100/Tool-Logging
  13. Next 41 trace() debug() info () warn () error() message

    01 message 02 message 03 message 04 message 05 Logger Appender Appender
  14. CSC 509 Software Engineering Javier Gonzalez-Sanchez, Ph.D. [email protected] Fall 2024

    Copyright. These slides can only be used as study material for the class CSC509 at Cal Poly. They cannot be distributed or used for another purpose.