SlideShare a Scribd company logo
1 of 19
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 WritingSchalk 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
 
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.pptxvishal choudhary
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit TestChiew Carol
 
Angular - injection tokens & Custom libraries
Angular - injection tokens & Custom librariesAngular - injection tokens & Custom libraries
Angular - injection tokens & Custom librariesEliran Eliassy
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelinescpsitgmbh
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJSPeter Drinnan
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application TestingTroy 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 GulpAll Things Open
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introductionNir 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 9aminmesbahi
 
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 BINDINGHitesh Mohapatra
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python CeleryMahendra M
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with GradleWei Chen
 
Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Eliran 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 SolutionsAndrew 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ãoWK Sistemas
 
110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETIN110614 GEOFF'S LATEST MEDICAL BULLETIN
110614 GEOFF'S LATEST MEDICAL BULLETINKanda P.
 
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 personalizadasMarilyn Cuasapas
 
PLC 110606 AGENDA
PLC 110606 AGENDAPLC 110606 AGENDA
PLC 110606 AGENDAKanda 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 bossAvil Porwal
 
Ria Story Testimonials
Ria Story TestimonialsRia Story Testimonials
Ria Story TestimonialsRia Story
 
The secrets of human heart
The secrets of human heartThe secrets of human heart
The secrets of human heartInamullah Khan
 
SA Human Capital trends 2016
SA Human Capital trends 2016 SA Human Capital trends 2016
SA Human Capital trends 2016 Luniel Botes
 
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 studentsPartnered Health
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworksMD Sayem Ahmed
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
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 84Mahmoud Samir Fayed
 
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 DatastoreRyan 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 sbtFabio 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.pdfStephieJohn
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksMongoDB
 
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

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...Health
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 

Recently uploaded (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 

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