SlideShare a Scribd company logo
6.1-6.2
by Group111
Solution – Exercise 6.1 (Frameworks)
Chosen Pattern: Factory Design Pattern
Properties of the pattern:
• Define the class of an object at run time.
In our case, the UI component like comboBox are created in run time. If for further cases its
required to use any other component like radio box, we can easily add the class and the class will be loaded
at the run time.
• It also allows to encapsulate object creation so that you can keep all object creation code in one place.
In our case, to create the comboBox we write newComboBox.OrderComponent. If we have to
create the radio box then we will define the newRadioBox.OrderComponent.
• Generally its has a method named factory methods which returns one of several possible classes that
share a common super class.
For our scenario, the name of the method is orderComponent which returns the component as
per as requested.
• It obeys the “DEPENDENCY INVERSION PRINCIPLE” means depend upon abstraction. Do not depend
upon concrete classes.
In this class, the abstraction class is javax.swing.Jcomponent. This class acts as a bridge between
the creator and product.
Followed Principles
• HollyWood Principle:
In our code, user will call the calculationOfFree Spaces, and the framework will
automatically call the corresponding class for executing the method.
• Open For Extension but not for modification:
We can extend the code CalculationOfFlat but we can not modify the existing code.
Solution – Exercise 6.2 (RESTful Webservices)
1. We edit the ImageResource class in the given prototype application. addImage()
function will receive the image url via GET method. After getting the file path it
stores the file path in the Image object and then save it to the list which was
provided.
c…
It returns 1 that means this url has successfully added.
Publish from the clint
2. We add a publish button in our SWCArchitect interior design application.
That application is act like a client. Client would also verify if publish is successful. A
popup message is shown according to response. In addition, we do some url decoding
and encoding techniques for passing file url via REST.
When publish a design
PublishTool.java
• File file = new File("img" + File.separator + "pub.png");
• int count = 0;
• while (file.exists()) {
• file = new File("img" + File.separator + "pub" + count + ".png");
• count++;
• }
• String path = file.getPath();
• ImageOutputFormat outputFormat = new ImageOutputFormat();
• try {
• for (DrawingView drawingView : this.editor.getDrawingViews()) {
• outputFormat.write(file, drawingView.getDrawing());
• }
• } catch (Exception e) {
• e.printStackTrace();
• }
c…..
• final String USER_AGENT = "Mozilla/5.0";
• String url = "http://localhost:8080/image/pub/";
• String loc = file.getAbsolutePath().replace(String.valueOf(File.separatorChar), "-").replace(".png", "");
• String param = "?format=image";
• URL obj;
• try {
• String urlFull = url + loc + param;
• obj = new URL(urlFull);
• HttpURLConnection con = (HttpURLConnection) obj.openConnection();
• System.out.println(urlFull);
• con.setRequestMethod("GET");
• con.setRequestProperty("User-Agent", USER_AGENT);
• int responseCode = con.getResponseCode();
• BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
• String inputLine;
• StringBuffer response = new StringBuffer();
• while ((inputLine = in.readLine()) != null) {
• response.append(inputLine);
• }
• if (Integer.parseInt(response.toString())==1) {
• JOptionPane.showMessageDialog(editor.getActiveView().getComponent(), "Successfully Published!");
• } else {
• JOptionPane.showMessageDialog(editor.getActiveView().getComponent(), "Cannot Published!!");
Image.java
Implement approve and deny
3. We wrote different functions for deny and allow operations and also they have their own
request mapping. Initially when an image is published, it would not be shown in the Home page. Initially
pictures can be seen in admin tab. Then if you allow a picture it is shown in the home page. And also
there is a option to deny the images again. If the application restart the previous published images will
remove.
Admin.js
Admin.html
Initially no image is approved
What is in admin tab?
After Approve
Approved image can be deny again

More Related Content

What's hot

Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
Schalk Cronjé
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJiayun Zhou
 
Celery with python
Celery with pythonCelery with python
Celery with python
Alexandre González Rodríguez
 
Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptx
vishal choudhary
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
Chiew Carol
 
XML-Motor
XML-MotorXML-Motor
XML-Motor
Abhishek Kumar
 
Angular - injection tokens & Custom libraries
Angular - injection tokens & Custom librariesAngular - injection tokens & Custom libraries
Angular - injection tokens & Custom libraries
Eliran Eliassy
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
cpsitgmbh
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
Peter Drinnan
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application Testing
Troy Miles
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
All Things Open
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
Schalk Cronjé
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
Nir Kaufman
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9
aminmesbahi
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
Hitesh Mohapatra
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python Celery
Mahendra M
 
SERVIET
SERVIETSERVIET
SERVIET
sathish sak
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
Wei Chen
 
Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019
Eliran Eliassy
 

What's hot (20)

Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSF
 
Celery with python
Celery with pythonCelery with python
Celery with python
 
Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptx
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
XML-Motor
XML-MotorXML-Motor
XML-Motor
 
Angular - injection tokens & Custom libraries
Angular - injection tokens & Custom librariesAngular - injection tokens & Custom libraries
Angular - injection tokens & Custom libraries
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
 
Corba by Example
Corba by ExampleCorba by Example
Corba by Example
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application Testing
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python Celery
 
SERVIET
SERVIETSERVIET
SERVIET
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019
 

Viewers also liked

FARO 3D Metrology Solutions
FARO 3D Metrology SolutionsFARO 3D Metrology Solutions
FARO 3D Metrology Solutions
Andrew McEwen
 
Caso de Sucesso WK - Gera Maranhão
Caso de Sucesso WK - Gera MaranhãoCaso de Sucesso WK - Gera Maranhão
Caso de Sucesso WK - Gera Maranhão
WK Sistemas
 
110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETIN110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETIN
Kanda P.
 
Origen del internet
Origen del internetOrigen del internet
Origen del internet
Patricia Cedilo
 
Solacasine
SolacasineSolacasine
Solacasine
AliAnus Khan
 
Vins老師a課程最後200名報名
Vins老師a課程最後200名報名Vins老師a課程最後200名報名
Vins老師a課程最後200名報名LJH P
 
4.Creación de listas personalizadas
4.Creación de listas personalizadas4.Creación de listas personalizadas
4.Creación de listas personalizadas
Marilyn Cuasapas
 
PLC 110606 AGENDA
PLC 110606 AGENDAPLC 110606 AGENDA
PLC 110606 AGENDA
Kanda P.
 
Best coding practices to follow - to write a code, like a boss
Best coding practices to follow - to write a code, like a bossBest coding practices to follow - to write a code, like a boss
Best coding practices to follow - to write a code, like a boss
Avil Porwal
 
Ria Story Testimonials
Ria Story TestimonialsRia Story Testimonials
Ria Story TestimonialsRia Story
 
Inecuaciones. academia docx
Inecuaciones. academia docxInecuaciones. academia docx
Inecuaciones. academia docx
darwin idrogo perez
 
The secrets of human heart
The secrets of human heartThe secrets of human heart
The secrets of human heart
Inamullah Khan
 
SA Human Capital trends 2016
SA Human Capital trends 2016 SA Human Capital trends 2016
SA Human Capital trends 2016
Luniel Botes
 
Richard dyer research final
Richard dyer research finalRichard dyer research final
Richard dyer research final
dynamiteblogger221
 
Angelina fernandez 1m
Angelina fernandez  1mAngelina fernandez  1m
Angelina fernandez 1mangelbert09
 

Viewers also liked (17)

FARO 3D Metrology Solutions
FARO 3D Metrology SolutionsFARO 3D Metrology Solutions
FARO 3D Metrology Solutions
 
Caso de Sucesso WK - Gera Maranhão
Caso de Sucesso WK - Gera MaranhãoCaso de Sucesso WK - Gera Maranhão
Caso de Sucesso WK - Gera Maranhão
 
Resumecurrent
ResumecurrentResumecurrent
Resumecurrent
 
110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETIN110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETIN
 
Origen del internet
Origen del internetOrigen del internet
Origen del internet
 
Solacasine
SolacasineSolacasine
Solacasine
 
Vins老師a課程最後200名報名
Vins老師a課程最後200名報名Vins老師a課程最後200名報名
Vins老師a課程最後200名報名
 
Carmen
CarmenCarmen
Carmen
 
4.Creación de listas personalizadas
4.Creación de listas personalizadas4.Creación de listas personalizadas
4.Creación de listas personalizadas
 
PLC 110606 AGENDA
PLC 110606 AGENDAPLC 110606 AGENDA
PLC 110606 AGENDA
 
Best coding practices to follow - to write a code, like a boss
Best coding practices to follow - to write a code, like a bossBest coding practices to follow - to write a code, like a boss
Best coding practices to follow - to write a code, like a boss
 
Ria Story Testimonials
Ria Story TestimonialsRia Story Testimonials
Ria Story Testimonials
 
Inecuaciones. academia docx
Inecuaciones. academia docxInecuaciones. academia docx
Inecuaciones. academia docx
 
The secrets of human heart
The secrets of human heartThe secrets of human heart
The secrets of human heart
 
SA Human Capital trends 2016
SA Human Capital trends 2016 SA Human Capital trends 2016
SA Human Capital trends 2016
 
Richard dyer research final
Richard dyer research finalRichard dyer research final
Richard dyer research final
 
Angelina fernandez 1m
Angelina fernandez  1mAngelina fernandez  1m
Angelina fernandez 1m
 

Similar to Group111

Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
Partnered Health
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
MD Sayem Ahmed
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
CodeFest
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
Mahmoud Samir Fayed
 
Design patterns
Design patternsDesign patterns
Design patterns
Anas Alpure
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
Spock
SpockSpock
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
Lviv Startup Club
 
Data Migrations in the App Engine Datastore
Data Migrations in the App Engine DatastoreData Migrations in the App Engine Datastore
Data Migrations in the App Engine Datastore
Ryan Morlok
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
Fabio Fumarola
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
StephieJohn
 
React inter3
React inter3React inter3
React inter3
Oswald Campesato
 
Kotlin talk
Kotlin talkKotlin talk
Kotlin talk
Klemen Kresnik
 
Osgi
OsgiOsgi
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
MongoDB
 
Gradle
GradleGradle
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
Antoine Sabot-Durand
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
Virtual JBoss User Group
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 

Similar to Group111 (20)

Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
Spock
SpockSpock
Spock
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
 
Data Migrations in the App Engine Datastore
Data Migrations in the App Engine DatastoreData Migrations in the App Engine Datastore
Data Migrations in the App Engine Datastore
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
React inter3
React inter3React inter3
React inter3
 
Kotlin talk
Kotlin talkKotlin talk
Kotlin talk
 
Osgi
OsgiOsgi
Osgi
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Gradle
GradleGradle
Gradle
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 

More from Shahriar Robbani (14)

SQL
SQLSQL
SQL
 
Oop lecture9 13
Oop lecture9 13Oop lecture9 13
Oop lecture9 13
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
 
Oop lecture9 10
Oop lecture9 10Oop lecture9 10
Oop lecture9 10
 
Oop lecture8
Oop lecture8Oop lecture8
Oop lecture8
 
Oop lecture9 11
Oop lecture9 11Oop lecture9 11
Oop lecture9 11
 
Oop lecture4
Oop lecture4Oop lecture4
Oop lecture4
 
Oop lecture2
Oop lecture2Oop lecture2
Oop lecture2
 
Oop lecture9
Oop lecture9Oop lecture9
Oop lecture9
 
Oop lecture7
Oop lecture7Oop lecture7
Oop lecture7
 
Oop lecture5
Oop lecture5Oop lecture5
Oop lecture5
 
Oop lecture3
Oop lecture3Oop lecture3
Oop lecture3
 
Oop lecture1
Oop lecture1Oop lecture1
Oop lecture1
 
Oop lecture6
Oop lecture6Oop lecture6
Oop lecture6
 

Recently uploaded

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 

Recently uploaded (20)

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 

Group111

  • 2. Solution – Exercise 6.1 (Frameworks) Chosen Pattern: Factory Design Pattern Properties of the pattern: • Define the class of an object at run time. In our case, the UI component like comboBox are created in run time. If for further cases its required to use any other component like radio box, we can easily add the class and the class will be loaded at the run time. • It also allows to encapsulate object creation so that you can keep all object creation code in one place. In our case, to create the comboBox we write newComboBox.OrderComponent. If we have to create the radio box then we will define the newRadioBox.OrderComponent. • Generally its has a method named factory methods which returns one of several possible classes that share a common super class. For our scenario, the name of the method is orderComponent which returns the component as per as requested. • It obeys the “DEPENDENCY INVERSION PRINCIPLE” means depend upon abstraction. Do not depend upon concrete classes. In this class, the abstraction class is javax.swing.Jcomponent. This class acts as a bridge between the creator and product.
  • 3.
  • 4.
  • 5. Followed Principles • HollyWood Principle: In our code, user will call the calculationOfFree Spaces, and the framework will automatically call the corresponding class for executing the method. • Open For Extension but not for modification: We can extend the code CalculationOfFlat but we can not modify the existing code.
  • 6. Solution – Exercise 6.2 (RESTful Webservices) 1. We edit the ImageResource class in the given prototype application. addImage() function will receive the image url via GET method. After getting the file path it stores the file path in the Image object and then save it to the list which was provided.
  • 7. c… It returns 1 that means this url has successfully added.
  • 8. Publish from the clint 2. We add a publish button in our SWCArchitect interior design application. That application is act like a client. Client would also verify if publish is successful. A popup message is shown according to response. In addition, we do some url decoding and encoding techniques for passing file url via REST.
  • 9. When publish a design
  • 10. PublishTool.java • File file = new File("img" + File.separator + "pub.png"); • int count = 0; • while (file.exists()) { • file = new File("img" + File.separator + "pub" + count + ".png"); • count++; • } • String path = file.getPath(); • ImageOutputFormat outputFormat = new ImageOutputFormat(); • try { • for (DrawingView drawingView : this.editor.getDrawingViews()) { • outputFormat.write(file, drawingView.getDrawing()); • } • } catch (Exception e) { • e.printStackTrace(); • }
  • 11. c….. • final String USER_AGENT = "Mozilla/5.0"; • String url = "http://localhost:8080/image/pub/"; • String loc = file.getAbsolutePath().replace(String.valueOf(File.separatorChar), "-").replace(".png", ""); • String param = "?format=image"; • URL obj; • try { • String urlFull = url + loc + param; • obj = new URL(urlFull); • HttpURLConnection con = (HttpURLConnection) obj.openConnection(); • System.out.println(urlFull); • con.setRequestMethod("GET"); • con.setRequestProperty("User-Agent", USER_AGENT); • int responseCode = con.getResponseCode(); • BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); • String inputLine; • StringBuffer response = new StringBuffer(); • while ((inputLine = in.readLine()) != null) { • response.append(inputLine); • } • if (Integer.parseInt(response.toString())==1) { • JOptionPane.showMessageDialog(editor.getActiveView().getComponent(), "Successfully Published!"); • } else { • JOptionPane.showMessageDialog(editor.getActiveView().getComponent(), "Cannot Published!!");
  • 13. Implement approve and deny 3. We wrote different functions for deny and allow operations and also they have their own request mapping. Initially when an image is published, it would not be shown in the Home page. Initially pictures can be seen in admin tab. Then if you allow a picture it is shown in the home page. And also there is a option to deny the images again. If the application restart the previous published images will remove.
  • 16. Initially no image is approved
  • 17. What is in admin tab?
  • 19. Approved image can be deny again